How to pass ARRAY[] parameters in sql and python?

Comments

3 comments

  • Avatar
    Randy Zwitch

    Hi @zipeng -

    Currently, we do not support using variable-width functions in UDFs. So passing ~~arrays~~, strings or ~~geospatial~~ types won't work. Using integers, float, boolean should work.

    As we develop the user-defined function functionality further, we hope to support these other types, but unfortunately I don't know the timeline for that.

    Best, Randy

    Edited based on @anon45925161 clarification

    0
    Comment actions Permalink
  • Avatar
    zipeng liu

    Thanks a lot Randy for the clarification. Looking forward to new stuff coming.

    0
    Comment actions Permalink
  • Avatar
    anon45925161

    Hi @zipeng,

    Thanks for the question! To clarify @randyzwitch's response, we do support variable-length datatypes as UDF inputs -- namely arrays and geospatial types (we do not yet support string inputs). We also support varlen array outputs now, in C++ -- see https://github.com/omnisci/omniscidb/blob/master/Tests/UdfTest.cpp#L473 for an example.

    However, we do not support the ARRAY function yet. Our variable length runtime is built to read directly from input buffers. ARRAY attempts to mimic an input buffer, but isn't quite identical. We have a project underway to move the varlen runtime from reading from input buffers to having its own intermediate representation (the representation already exists, called ArrayDatum), but it is performance sensitive so we have to be a little careful.

    I'll post here once we have some progress -- should be weeks to months, not months to years.

    Thanks, Alex

    0
    Comment actions Permalink

Please sign in to leave a comment.