drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Muhammad Gelbana <m.gelb...@gmail.com>
Subject UDF parameters
Date Mon, 23 Jan 2017 09:18:21 GMT
I need to create a UDF with the following properties:

   - Accepts variable amount of parameters (1, 2, 3...etc parameters)
   - Some or all the parameters may be null
   - All parameters are numerical
   - Some or all the parameters may be fed by literals or columns selected
   from a parquet file (*SELECT my_udf(COL1, COL2, 123) FROM
   - Depending on the parameters, the UDF may return NULL.

When I use a Nullable holder such as *NullableVarChar*, I can't pass it a
literal value because the method signature expects an optional value (i.e.
a value from a column that *may* by null, not always having a value such as
a literal)

Remember that the UDF need to have a variable amount of parameters. If this
is not currently possible, I'll have to create multiple UDFs with multiple
amount of parameters and if I do that, I will desperately need a *single*
value holder type that accepts columns, literals, integers and doubles.

My questions are

   1. Is there a value holder that accepts literals & columns for integers
   & doubles ?
   2. Is there a value holder that accepts any kind of input ? Like
   *java.util.Object* in java ?

*Muhammad Gelbana*

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message