hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-2249) When creating constant expression for numbers, try to infer type from another comparison operand, instead of trying to use integer first, and then long and double
Date Wed, 09 Jan 2013 10:25:14 GMT

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

Hudson commented on HIVE-2249:
------------------------------

Integrated in Hive-trunk-hadoop2 #54 (See [https://builds.apache.org/job/Hive-trunk-hadoop2/54/])
    HIVE-2249 When creating constant expression for numbers, try to infer type from another
comparison operand, instead of trying to use integer first, and then long and double (Zhiqiu
Kong via Siying Dong) (Revision 1238175)

     Result = ABORTED
sdong : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1238175
Files : 
* /hive/trunk/contrib/src/test/results/clientpositive/dboutput.q.out
* /hive/trunk/contrib/src/test/results/clientpositive/serde_typedbytes4.q.out
* /hive/trunk/data/files/infer_const_type.txt
* /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
* /hive/trunk/ql/src/test/queries/clientpositive/infer_const_type.q
* /hive/trunk/ql/src/test/queries/clientpositive/insert1_overwrite_partitions.q
* /hive/trunk/ql/src/test/queries/clientpositive/insert2_overwrite_partitions.q
* /hive/trunk/ql/src/test/queries/clientpositive/ppr_pushdown.q
* /hive/trunk/ql/src/test/results/clientpositive/auto_join0.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join11.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join12.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join13.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join14.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join16.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join20.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join21.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join23.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join27.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join28.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join29.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join4.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join5.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join6.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join7.q.out
* /hive/trunk/ql/src/test/results/clientpositive/auto_join8.q.out
* /hive/trunk/ql/src/test/results/clientpositive/cast1.q.out
* /hive/trunk/ql/src/test/results/clientpositive/cluster.q.out
* /hive/trunk/ql/src/test/results/clientpositive/create_view.q.out
* /hive/trunk/ql/src/test/results/clientpositive/groupby_multi_single_reducer.q.out
* /hive/trunk/ql/src/test/results/clientpositive/having.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_auto.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_auto_empty.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_auto_file_format.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_auto_mult_tables.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_auto_mult_tables_compact.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_auto_multiple.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_auto_partitioned.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_auto_self_join.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_auto_unused.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_auto_update.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_bitmap3.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_bitmap_auto.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_bitmap_auto_partitioned.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_bitmap_compression.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_compression.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_stale.q.out
* /hive/trunk/ql/src/test/results/clientpositive/index_stale_partitioned.q.out
* /hive/trunk/ql/src/test/results/clientpositive/infer_const_type.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input11.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input11_limit.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input12.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input13.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input14.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input14_limit.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input18.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input1_limit.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input2_limit.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input42.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input_part1.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input_part2.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input_part5.q.out
* /hive/trunk/ql/src/test/results/clientpositive/input_part7.q.out
* /hive/trunk/ql/src/test/results/clientpositive/insert1_overwrite_partitions.q.out
* /hive/trunk/ql/src/test/results/clientpositive/insert2_overwrite_partitions.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join0.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join11.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join12.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join13.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join14.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join16.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join20.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join21.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join23.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join34.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join35.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join38.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join39.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join4.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join40.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join5.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join6.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join7.q.out
* /hive/trunk/ql/src/test/results/clientpositive/join8.q.out
* /hive/trunk/ql/src/test/results/clientpositive/load_dyn_part13.q.out
* /hive/trunk/ql/src/test/results/clientpositive/louter_join_ppr.q.out
* /hive/trunk/ql/src/test/results/clientpositive/multi_insert.q.out
* /hive/trunk/ql/src/test/results/clientpositive/no_hooks.q.out
* /hive/trunk/ql/src/test/results/clientpositive/noalias_subq1.q.out
* /hive/trunk/ql/src/test/results/clientpositive/notable_alias1.q.out
* /hive/trunk/ql/src/test/results/clientpositive/notable_alias2.q.out
* /hive/trunk/ql/src/test/results/clientpositive/nullgroup.q.out
* /hive/trunk/ql/src/test/results/clientpositive/nullgroup2.q.out
* /hive/trunk/ql/src/test/results/clientpositive/nullgroup4.q.out
* /hive/trunk/ql/src/test/results/clientpositive/nullgroup4_multi_distinct.q.out
* /hive/trunk/ql/src/test/results/clientpositive/order2.q.out
* /hive/trunk/ql/src/test/results/clientpositive/outer_join_ppr.q.out
* /hive/trunk/ql/src/test/results/clientpositive/pcr.q.out
* /hive/trunk/ql/src/test/results/clientpositive/ppd_clusterby.q.out
* /hive/trunk/ql/src/test/results/clientpositive/ppd_multi_insert.q.out
* /hive/trunk/ql/src/test/results/clientpositive/ppd_outer_join1.q.out
* /hive/trunk/ql/src/test/results/clientpositive/ppd_transform.q.out
* /hive/trunk/ql/src/test/results/clientpositive/ppd_udf_col.q.out
* /hive/trunk/ql/src/test/results/clientpositive/ppr_pushdown.q.out
* /hive/trunk/ql/src/test/results/clientpositive/ppr_pushdown3.q.out
* /hive/trunk/ql/src/test/results/clientpositive/quote1.q.out
* /hive/trunk/ql/src/test/results/clientpositive/rand_partitionpruner3.q.out
* /hive/trunk/ql/src/test/results/clientpositive/rcfile_null_value.q.out
* /hive/trunk/ql/src/test/results/clientpositive/regex_col.q.out
* /hive/trunk/ql/src/test/results/clientpositive/regexp_extract.q.out
* /hive/trunk/ql/src/test/results/clientpositive/router_join_ppr.q.out
* /hive/trunk/ql/src/test/results/clientpositive/semijoin.q.out
* /hive/trunk/ql/src/test/results/clientpositive/set_processor_namespaces.q.out
* /hive/trunk/ql/src/test/results/clientpositive/skewjoin.q.out
* /hive/trunk/ql/src/test/results/clientpositive/subq.q.out
* /hive/trunk/ql/src/test/results/clientpositive/subq2.q.out
* /hive/trunk/ql/src/test/results/clientpositive/transform_ppr1.q.out
* /hive/trunk/ql/src/test/results/clientpositive/transform_ppr2.q.out
* /hive/trunk/ql/src/test/results/clientpositive/udf1.q.out
* /hive/trunk/ql/src/test/results/clientpositive/udf9.q.out
* /hive/trunk/ql/src/test/results/clientpositive/udf_10_trims.q.out
* /hive/trunk/ql/src/test/results/clientpositive/udf_hour.q.out
* /hive/trunk/ql/src/test/results/clientpositive/udf_like.q.out
* /hive/trunk/ql/src/test/results/clientpositive/udf_lower.q.out
* /hive/trunk/ql/src/test/results/clientpositive/udf_minute.q.out
* /hive/trunk/ql/src/test/results/clientpositive/udf_parse_url.q.out
* /hive/trunk/ql/src/test/results/clientpositive/udf_second.q.out
* /hive/trunk/ql/src/test/results/clientpositive/udf_union.q.out
* /hive/trunk/ql/src/test/results/clientpositive/union.q.out
* /hive/trunk/ql/src/test/results/clientpositive/union20.q.out
* /hive/trunk/ql/src/test/results/clientpositive/union22.q.out
* /hive/trunk/ql/src/test/results/clientpositive/union24.q.out
* /hive/trunk/ql/src/test/results/clientpositive/union_ppr.q.out
* /hive/trunk/ql/src/test/results/compiler/plan/cast1.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/input1.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/input2.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/input3.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/input4.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/input_part1.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/join4.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/join5.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/join6.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/join7.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/join8.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/subq.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/udf1.q.xml
* /hive/trunk/ql/src/test/results/compiler/plan/union.q.xml

                
> When creating constant expression for numbers, try to infer type from another comparison
operand, instead of trying to use integer first, and then long and double
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-2249
>                 URL: https://issues.apache.org/jira/browse/HIVE-2249
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Siying Dong
>            Assignee: Zhiqiu Kong
>             Fix For: 0.9.0
>
>         Attachments: ASF.LICENSE.NOT.GRANTED--HIVE-2249.D1383.1.patch, ASF.LICENSE.NOT.GRANTED--HIVE-2249.D1383.2.patch,
ASF.LICENSE.NOT.GRANTED--HIVE-2249.D1383.3.patch, ASF.LICENSE.NOT.GRANTED--HIVE-2249.D1383.4.patch,
HIVE-2249.1.patch.txt, HIVE-2249.2.patch.txt
>
>
> The current code to build constant expression for numbers, here is the code:
>      try {
>         v = Double.valueOf(expr.getText());
>         v = Long.valueOf(expr.getText());
>         v = Integer.valueOf(expr.getText());
>       } catch (NumberFormatException e) {
>         // do nothing here, we will throw an exception in the following block
>       }
>       if (v == null) {
>         throw new SemanticException(ErrorMsg.INVALID_NUMERICAL_CONSTANT
>             .getMsg(expr));
>       }
>       return new ExprNodeConstantDesc(v);
> The for the case that "WHERE <BIG_INT_COLUMN> = 0", or "WHERE <DOUBLE_COLUMN>
= 0", we always have to do a type conversion when comparing, which is unnecessary if it is
slightly smarter to choose type when creating the constant expression. We can simply walk
one level up the tree, find another comparison party and use the same type with that one if
it is possible. For user's wrong query like '<INT_COLUMN>=1.1', we can even do more.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message