[ 
https://issues.apache.org/jira/browse/HIVE-2427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Phabricator updated HIVE-2427:
------------------------------

    Attachment: HIVE-2427.D2181.1.patch

kevinwilfong requested code review of "HIVE-2427 [jira] Warn user that 
precision is lost when bigint is implicitly cast to double in joins and 
unions.".
Reviewers: JIRA

  https://issues.apache.org/jira/browse/HIVE-2427

  (Ran svn up to avoid merge conflicts and moved review to Phabricator)

  I added checks before the type conversions for both joins and unions to 
either throw an error or a warning depending if a bigint was going to be 
converted to a double.

  I also added a new variable hive.mapred.bigint.comparison.mode, which is set 
to either strict or nonstrict to indicate whether an error or a warning should 
be given when a bigint is converted to a double. This is instead of the 
original implementation which used the variable hive.mapred.mode.

  When a bigint is implicitly cast to a double (when a bigint is involved in an 
equality expression with a string or double as part of a join condition, or 
when a bigint column is to be combined with a string or double column as part 
of a union) precision may be lost, resulting in unexpected behavior. Until we 
fix the underlying issue we should throw an error in strict mode, and a warning 
in nonstrict mode alerting the user about this.

TEST PLAN
  EMPTY

REVISION DETAIL
  https://reviews.facebook.net/D2181

AFFECTED FILES
  conf/hive-default.xml.template
  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
  ql/src/test/results/clientnegative/compare_string_bigint.q.out
  ql/src/test/results/clientnegative/compare_string_bigint_union.q.out
  ql/src/test/results/clientnegative/compare_string_bigint_join.q.out
  ql/src/test/results/clientnegative/compare_double_bigint_union.q.out
  ql/src/test/results/clientnegative/compare_double_bigint_join.q.out
  ql/src/test/results/clientnegative/compare_double_bigint.q.out
  ql/src/test/results/clientpositive/filter_join_breaktask2.q.out
  ql/src/test/queries/clientnegative/compare_double_bigint_union.q
  ql/src/test/queries/clientnegative/compare_string_bigint_join.q
  ql/src/test/queries/clientnegative/compare_double_bigint.q
  ql/src/test/queries/clientnegative/compare_double_bigint_join.q
  ql/src/test/queries/clientnegative/compare_string_bigint.q
  ql/src/test/queries/clientnegative/compare_string_bigint_union.q
  ql/src/test/queries/clientpositive/filter_join_breaktask2.q
  ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java
  ql/src/java/org/apache/hadoop/hive/ql/parse/ErrorMsg.java
  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java

MANAGE HERALD DIFFERENTIAL RULES
  https://reviews.facebook.net/herald/view/differential/

WHY DID I GET THIS EMAIL?
  https://reviews.facebook.net/herald/transcript/4779/

Tip: use the X-Herald-Rules header to filter Herald messages in your client.

                
> Warn user that precision is lost when bigint is implicitly cast to double in 
> joins and unions.
> ----------------------------------------------------------------------------------------------
>
>                 Key: HIVE-2427
>                 URL: https://issues.apache.org/jira/browse/HIVE-2427
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Kevin Wilfong
>            Assignee: Kevin Wilfong
>         Attachments: HIVE-2427.1.patch.txt, HIVE-2427.2.patch.txt, 
> HIVE-2427.3.patch.txt, HIVE-2427.D2181.1.patch
>
>
> When a bigint is implicitly cast to a double (when a bigint is involved in an 
> equality expression with a string or double as part of a join condition, or 
> when a bigint column is to be combined with a string or double column as part 
> of a union) precision may be lost, resulting in unexpected behavior. Until we 
> fix the underlying issue we should throw an error in strict mode, and a 
> warning in nonstrict mode alerting the user about this.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to