impala-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lorenzo Bagni (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IMPALA-5580) Java UDF return null issue with STRING input
Date Mon, 26 Jun 2017 17:19:00 GMT
Lorenzo Bagni created IMPALA-5580:
-------------------------------------

             Summary: Java UDF return null issue with STRING input
                 Key: IMPALA-5580
                 URL: https://issues.apache.org/jira/browse/IMPALA-5580
             Project: IMPALA
          Issue Type: Bug
          Components: Backend
    Affects Versions: Impala 2.8.0
            Reporter: Lorenzo Bagni
            Priority: Blocker


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:
{code:sql}
[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
{code}
On impala v2.6.0 the same UDF works correcty.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message