Re: UDF - Access Tuple Column Values By Name

2015-05-06 Thread Jaime Solano
Hi Kathir, I don't know if that's posible, but seems like the better approach is to just define your function to take two arguments. What do you think? Best, -Jaime On May 6, 2015 7:50 AM, Kathiresan S kathiresanselva...@gmail.com wrote: Hi, In UDF, in the implemented evaluate(tuple,ptr)

Re: Phoenix Array Type Null Element

2015-05-06 Thread Kathiresan S
Thanks Ram. Thanks, Kathir On Wed, May 6, 2015 at 1:56 AM, Vasudevan, Ramkrishna S ramkrishna.s.vasude...@intel.com wrote: I raised https://issues.apache.org/jira/browse/PHOENIX-1949 for fixing this. *From:* Vasudevan, Ramkrishna S [mailto:ramkrishna.s.vasude...@intel.com] *Sent:*

org.apache.phoenix.schema.ConstraintViolationException

2015-05-06 Thread PengCheng Liang
Hi all, Is a character set error? 0: jdbc:phoenix:mvxl0490 CREATE INDEX css_cus_idx ON css.t_cs_customer(SUBSTR(STELEPHONE1, 1, 11)); Error: org.apache.phoenix.schema.ConstraintViolationException: CSS.CSS_CUS_IDX.: SUBSTR(CUST.STELEPHONE1,1,11) may not exceed 11 bytes ('87678000(李女')

UDF - Access Tuple Column Values By Name

2015-05-06 Thread Kathiresan S
Hi, In UDF, in the implemented evaluate(tuple,ptr) method, i could access the expression object of the columns passed to the UDF, by invoking *getChildren.get(index)*. and then by invoking expression.evaluate(tuple,ptr), i can get the value copied to the ptr object. But, how do i access other

Re: UDF - Access Tuple Column Values By Name

2015-05-06 Thread Kathiresan S
Hi Jaime, In my case, the number of arguments passed to the custom function will be different in different scenarios. I think UDF is designed to take fixed number of arguments, i believe (also, I see number of arguments column in SYSTEM.FUNCTION table). Another question - As we have the row

Re: UDF - Access Tuple Column Values By Name

2015-05-06 Thread James Taylor
+1 to Jaime's suggestion of providing multiple arguments. You can have a variable number of arguments to a function by providing default values for trailing arguments. I wouldn't rely on the Tuple argument in the evaluate method as it might go away in the future (PHOENIX-1887). Thanks, James On