Open MEDSMEDS opened 3 years ago
The issues are not the best way to get help with UDFs. Did you try #dev
channel on our slack?
OK. will redirect to slack.
Hitting the same issue. NPE will happen if @SqlNullable
annotation is missing.
The slack history is gone. Anyone knows what's the discussion conclusion?
Also noticed there is CI check error when using @SqlNullable
annotation on primitive type:
"Method [%s] annotated with @SqlNullable has primitive return type %s"
But no such check for non-primitive types. Would require to use either SqlNullable
or SqlNonNull
on non-primitive types help? (with a new annotation)
The stack looks like this:
the following code in
ParametricScalarImplementation.java
handle error cases only for boxed/primitive type, but not for other type that will accept null pointer.So in
BytecodeUtils.java
the null ptr is not handled properly because theisNullable()
is false, thewasNullVariable
logic will not be included in codegen.generateWrite()
will generate code that call the following method without check.So is it possible to widen the check in point 3 to eliminate the problem? UDF incurred bug pops up very frequent and we hope to detect problems as much as possible during plugin installation stage. The annotation based UDF programming is great but the code is too flexible sometimes.
Thanks!