Details
Description
I'm coding phoenix user-defined function recently.I have a problem when i code the function.I need to check the filed is null or not null.I upsert the data in phoenix set the filed null.Here is the code.
String sourceStr = (String) getSourceStrExpression().getDataType().toObject(ptr,
getSourceStrExpression().getSortOrder());
if (ptr.getLength() == 0)
else
{ ptr.set(PVarchar.INSTANCE.toBytes("true"));}I always get true in phoenix but i think i will get false.
How can i check the field is null?