Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
Impala 2.8.0
-
ghx-label-7
Description
Hi all,
I'm facing on wrong behaviour using Java UDF, when i declare a 'return null;' inside the code and I call the function the value returned is a blank (like '' or "") value.
This happen when the input type is a STRING, just to be sure I've used the TestUdf:
http://impala.io/doc/html/TestUdf_8java_source.html
here's my tests:
[host:21000] > select testudf(cast(null as int)); Query: select testudf(cast(null as int)) --------------------------------+ | dwh.testudf(cast(null as int)) | +--------------------------------+ | NULL | +--------------------------------+ Fetched 1 row(s) in 0.12s [host:21000] > select testudf(cast(null as string)); Query: select testudf(cast(null as string)) +-----------------------------------+ | dwh.testudf(cast(null as string)) | +-----------------------------------+ | | +-----------------------------------+ Fetched 1 row(s) in 0.15s [host:21000] > select testudf(cast(null as string)) is null; Query: select testudf(cast(null as string)) is null +-------------------------------------------+ | dwh.testudf(cast(null as string)) is null | +-------------------------------------------+ | false | +-------------------------------------------+ Fetched 1 row(s) in 0.12s [host:21000] > select testudf(cast(null as int)) is null; Query: select testudf(cast(null as int)) is null +----------------------------------------+ | dwh.testudf(cast(null as int)) is null | +----------------------------------------+ | true | +----------------------------------------+ Fetched 1 row(s) in 0.15s
On impala v2.6.0 the same UDF works correcty.
Attachments
Issue Links
- is broken by
-
IMPALA-5252 Java UDF returning string can lead to crash under memory pressure.
- Resolved