Giter VIP home page Giter VIP logo

Comments (8)

davecramer avatar davecramer commented on September 14, 2024

@jottyfan what version of PL/R are you using ?

from plr.

 avatar commented on September 14, 2024

sorry, forgot to mention:

  • debian stretch (amd64)
me@local:~$ apt-cache policy postgresql-11-plr
postgresql-11-plr:
  Installiert:           1:8.4-1.pgdg90+1
  Installationskandidat: 1:8.4-1.pgdg90+1
  Versionstabelle:
 *** 1:8.4-1.pgdg90+1 500
        500 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
        100 /var/lib/dpkg/status

and

me@local:~$ apt-cache policy r-base
r-base:
  Installiert:           3.3.3-1
  Installationskandidat: 3.3.3-1
  Versionstabelle:
 *** 3.3.3-1 500
        500 http://ftp.de.debian.org/debian stretch/main amd64 Packages
        100 /var/lib/dpkg/status

from plr.

davecramer avatar davecramer commented on September 14, 2024

@jottyfan what is your expectation here ? The code as is does not work, but I'm curious what your use case is ?

from plr.

 avatar commented on September 14, 2024

Thanks for your fix.

My expectation is that I can use a plr-trigger on any postgreSQL-table, even if it contains bytea-columns. Besides, I found out that on tables with text columns, entries with very large content generate the same crash. I don't know exactly what the limit was, but I think about 32k. So my solution was to generate a postgresql trigger function in plr (after insert trigger) that handles the inserted values in any way; now I do this on a replacement table (without bytea) and do a select inside of the trigger by omitting the pg.tg.new record and do a select on the table instead. In the end, this is a upload functionality to parse some big files (xls, ods, csv, ...) to fill some other database tables. Doing so in a trigger function might be a weird use case, but I'm trying to find out what is possible, and currently, it looks very well...

from plr.

davecramer avatar davecramer commented on September 14, 2024

Well I don't think my fix is correct, all it does is stop the crash, I don't believe it ends up with anything usable. As for text columns I find that surprising.

As for plr-triggers, I expect it would be much easier to write triggers in plpgsql and then call R from there. It would be much easier to manipulate the row in plpgsql.

Thanks,
Dave

from plr.

 avatar commented on September 14, 2024

Well I don't think my fix is correct, all it does is stop the crash...

But for me this is a bugfix, it stops the crash. :)

As for plr-triggers, I expect it would be much easier to write triggers in plpgsql and then call R from there. It would be much easier to manipulate the row in plpgsql.

Yes, but... have you ever tried to parse an xls file with plpgsql? Doing so in R is easy, it saves me a lot of (dev) time. If I call R from plpgsql (still don't know how to do so), what was a reason to use plr then? I'd better give plr a chance.

from plr.

davecramer avatar davecramer commented on September 14, 2024

@jottyfan the semantics of bytea in PL/R is as follows: PL/R assumes that whatever is stored in the bytea object has been serialized by R using 'serialize'. The use case is: If you are pre-processing some data you might want to store it in a bytea object after serializing it. What this means is that unless the bytea data was a serialized R object there is no standard way for R to understand the bytes that have been stored in there. As I said you'd be better off using plpgsql and sanitizing any columns and then passing it to PL/R. You can do another select in plplgsql or in postgresql 11 you can call another procedure.

from plr.

davecramer avatar davecramer commented on September 14, 2024

lack of response

from plr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.