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

Alan Gates commented on HIVE-8105:
----------------------------------

insert into table T values ... works by first writing the values to a file, 
casting a temp table over that file, and then rewriting the query to insert 
into table T select * from temp_table.  As all of the values coming in are 
strings, the default Hive casting mechanisms kick in.  The Hive rule for 
casting from boolean to string is that any string that has length > 0 is true, 
while a zero length string is false.  (See UDFToBoolean.evaluate(Text)).

The ideal solution here is we need an input format that can handle these sorts 
of things as well as simple expressions.  For example, in the current 
implementation we cannot handle casts or arithmetic like insert into T values 
(3 + 4);  So yes, this is a stop gap.

> booleans and nulls not handled properly in insert/values
> --------------------------------------------------------
>
>                 Key: HIVE-8105
>                 URL: https://issues.apache.org/jira/browse/HIVE-8105
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 0.14.0
>            Reporter: Alan Gates
>            Assignee: Alan Gates
>            Priority: Critical
>         Attachments: HIVE-8105.patch
>
>
> Doing an insert/values with a boolean always results in a value of true, 
> regardless of whether true or false is given in the query.
> Doing an insert/values with a null for a column value results in a semantic 
> error.



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

Reply via email to