[ 
https://issues.apache.org/jira/browse/HIVE-8642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14188209#comment-14188209
 ] 

Nishant Kelkar commented on HIVE-8642:
--------------------------------------

Thanks [~navis]! This solves my problem. 

However, I feel that queries of the form "INSERT INTO TABLE table_a SELECT 
UDTF(args) AS (arg_names) FROM table_b" should have support for null field 
insertions. This is because the output of the UDTF is tightly coupled with the 
schema of table_a. Right now, debugging through the code showed that null 
arguments to a UDTF generate VoidObjectInspector as input to the initialize() 
method (which they shouldn't, since the schema of table_a should be sufficient 
information to get correct ObjectInspectors). 

Please correct me if I'm wrong (I've only started digging into Hive source 
code). Thoughts?

> Hive stack() UDTF Doesn't Support NULL Insert Values
> ----------------------------------------------------
>
>                 Key: HIVE-8642
>                 URL: https://issues.apache.org/jira/browse/HIVE-8642
>             Project: Hive
>          Issue Type: Improvement
>          Components: SQL, UDF
>    Affects Versions: 0.13.0
>            Reporter: Nishant Kelkar
>            Priority: Minor
>
> The following tables exist:
> 1. test_table --  schema {"field_a":STRING, "field_b":STRING, 
> "field_c":STRING}
> 2. dual -- schema {"field_1":INT}
> test_table contents:
> {code}
> en    dbpedia http://dbpedia.org/schools/CMU
> {code}
> dual contents:
> {code}
> 1
> {code}
> I tried the following query, and it fails:
> {code}
> INSERT INTO TABLE test_table SELECT 
> stack(1,
> "en",
> "dbpedia",
> NULL
> ) AS (
> field_a,
> field_b,
> field_c
> ) FROM dual;
> {code}
> The error returned: FAILED: NullPointerException null



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to