You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Zheng Shao (JIRA)" <ji...@apache.org> on 2009/08/06 23:02:14 UTC

[jira] Created: (HIVE-734) problem in dealing with null

problem in dealing with null
----------------------------

                 Key: HIVE-734
                 URL: https://issues.apache.org/jira/browse/HIVE-734
             Project: Hadoop Hive
          Issue Type: Bug
            Reporter: Zheng Shao
            Assignee: Ning Zhang


This command fails with the following error:
{code}
hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from null from zshao_tt"
FAILED: Error in semantic analysis:
java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
{code}

When 'null' is replaced by '' it works.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Ashish Thusoo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740257#action_12740257 ] 

Ashish Thusoo commented on HIVE-734:
------------------------------------

select null from null from zshao_tt ?? or is it select null from zshao_tt.



> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740258#action_12740258 ] 

Zheng Shao commented on HIVE-734:
---------------------------------

corrected. it's "select null from zshao_tt"


> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741582#action_12741582 ] 

Zheng Shao commented on HIVE-734:
---------------------------------

Discussed with Ning offline. SemanticAnalyzer.genFileSinkPlan() will be the place for the change - in case the target is a local/remote directory (instead of a table), when we create table column names and types, we should use string type if the input is a void type.  Later in the same function, we are using genConversionSelectOperator() to convert the column types.

So ODBC/JDBC will see this column as string type. Raghu confirmed that MySQL is creating a table with a column typed "BINARY(0)" when running "CREATE TABLE AS SELECT NULL, ..." 


> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741956#action_12741956 ] 

Ning Zhang commented on HIVE-734:
---------------------------------

Namit, thanks for the comments! I have started a new JIRA HIVE-747 for that. I'll look at this one soon. 

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HIVE-734) problem in dealing with null

Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Namit Jain resolved HIVE-734.
-----------------------------

      Resolution: Fixed
    Hadoop Flags: [Reviewed]

Committed. Thanks Ning

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>         Attachments: 734.patch
>
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12742129#action_12742129 ] 

Ning Zhang commented on HIVE-734:
---------------------------------

Cool!

Thank you very much!

Ning




> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>         Attachments: 734.patch
>
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740353#action_12740353 ] 

Ning Zhang commented on HIVE-734:
---------------------------------

The error is threw during semantic analysis where the parser try to instantiate an ObjectInspector for type "void" (corresponding to null). 

The following similar query succeeded:

select 2 from zshao_tt;

since the semantic analyzer is able to deduct type (int) from the constant 2. 

Since null can also be treated as a constant, I think we need to write an ObjectInspector for its type (void) too. And the object inspector will always return null for each row. 

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740277#action_12740277 ] 

Ning Zhang commented on HIVE-734:
---------------------------------

Thanks guys! I figured that out too. Debugging now.

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HIVE-734) problem in dealing with null

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ning Zhang updated HIVE-734:
----------------------------

    Attachment: 734.patch

fix attached.

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>         Attachments: 734.patch
>
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740773#action_12740773 ] 

Ning Zhang commented on HIVE-734:
---------------------------------

added the JavaVoidObjectInspector support for LazySimpleSerDe. Will add the same support to other serdes. 

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740650#action_12740650 ] 

Ning Zhang commented on HIVE-734:
---------------------------------

BTW, I tried joins and it doesn't handle NULL semantics correctly. Here's the data and results:

Table:

Key       Value
-------     -------
NULL    325
18         NULL

Query:

select * from input4_cb a join input4_cb b on a.key = b.value;

Result:

NULL  325   18   NULL

The correct result should be empty set.

I guess the NULL vs. NULL comparison is incorrectly evaluated. 


> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740392#action_12740392 ] 

Zheng Shao commented on HIVE-734:
---------------------------------

We do handle NULL in the WHERE clause and "AND", "OR" functions using the 3-value booleans.  I am not sure whether we ignore NULL in join/group-by but that seems easy enough to do.
Do you have a specific example that the current Hive code breaks?

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741667#action_12741667 ] 

Namit Jain commented on HIVE-734:
---------------------------------

hive> select * from (select NULL from zshao_tt union all select 1 from zshao_tt)x;
select * from (select NULL from zshao_tt union all select 1 from zshao_tt)x;
FAILED: Error in semantic analysis: Schema of both sides of union should match: Column _c0 is of type void on first table and type int on second table



Do you want to handle this also in this patch, or file a new jira for above ?

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740406#action_12740406 ] 

Ning Zhang commented on HIVE-734:
---------------------------------

I wasn't able to get an example in HIVE. I tried to insert NULL to a table by modifying the test query input4_cb_delim.q (actually by only modifying the input data to be 

<value1>\002\012
\002<value2>\012

and run the query

select * from input4_cb where key is not null;

and both rows are returned. So either the NULL values are not inserted correctly, or the evaluation is not correct about NULL.

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740782#action_12740782 ] 

Zheng Shao commented on HIVE-734:
---------------------------------

Good finding! Let's fix the join bug on a separate JIRA. Can you open a jira on that?
I am not sure about why we need to add JavaVoidObjectInspector support to LazySimpleSerDe - data from SerDe already have types (from columns).  We only need to handle NULL that user specified in the query. Thoughts?


> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740834#action_12740834 ] 

Ning Zhang commented on HIVE-734:
---------------------------------

In the failing query, there is no column corresponding to null (select null from tt), so the semantic analyzer doesn't know the type of the NULL, therefore it is VOID type. That's why JavaVoidObjectInspector needs to be created. It is the similar that in (select 2 from tt), An JavaIntegerObjectInspector is needed for the constant 2. 

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740388#action_12740388 ] 

Ning Zhang commented on HIVE-734:
---------------------------------

Thanks for the pointer Zheng. We certainly can use JavaVoidObjecInspector for NULL. However it turns out NULL is more complicated than what it sounds like (see http://en.wikipedia.org/wiki/Null_(SQL) ). NULL has to be handled not only in this simple select cause, but also in much more complex cases in the where-clause and joins. Let's have a talk.



> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12742115#action_12742115 ] 

Namit Jain commented on HIVE-734:
---------------------------------

+1

looks good - will commit if the tests pass

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>         Attachments: 734.patch
>
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740446#action_12740446 ] 

Zheng Shao commented on HIVE-734:
---------------------------------

With LazySimpleSerDe (the default), we represent NULL by two bytes: "\" and "N". This is in sync with MySQL export format.
Can you try again with that?

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HIVE-734) problem in dealing with null

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Steinbach updated HIVE-734:
--------------------------------

    Fix Version/s: 0.4.0
      Component/s: Query Processor

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Query Processor
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>             Fix For: 0.4.0
>
>         Attachments: 734.patch
>
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HIVE-734) problem in dealing with null

Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zheng Shao updated HIVE-734:
----------------------------

    Description: 
This command fails with the following error:
{code}
hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
FAILED: Error in semantic analysis:
java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
{code}

When 'null' is replaced by '' it works.


  was:
This command fails with the following error:
{code}
hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from null from zshao_tt"
FAILED: Error in semantic analysis:
java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
{code}

When 'null' is replaced by '' it works.



> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740544#action_12740544 ] 

Ning Zhang commented on HIVE-734:
---------------------------------

That's great! It works (and my test queries on NULL also works too). In this case I guess it is much simpler since what we need here is just the VOID type ObjectInspector. I'll working on it.

> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-734) problem in dealing with null

Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740358#action_12740358 ] 

Zheng Shao commented on HIVE-734:
---------------------------------

+1 on the idea. We have WritableVoidObjectInspector, JavaVoidObjectInspector etc but none are actually implemented or used.
Can we use JavaVoidObjectInspector for null constant? We probably need to modify ObjectInspectorConverters to allow conversion from void type to any type as well.


> problem in dealing with null
> ----------------------------
>
>                 Key: HIVE-734
>                 URL: https://issues.apache.org/jira/browse/HIVE-734
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Zheng Shao
>            Assignee: Ning Zhang
>
> This command fails with the following error:
> {code}
> hive/bin/hive -e "INSERT OVERWRITE LOCAL DIRECTORY 'abc' select null from zshao_tt"
> FAILED: Error in semantic analysis:
> java.lang.RuntimeException: Internal error: Cannot find ObjectInspector for VOID
> {code}
> When 'null' is replaced by '' it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.