[ https://issues.apache.org/jira/browse/HIVE-5878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13830776#comment-13830776 ]
Hive QA commented on HIVE-5878: ------------------------------- {color:red}Overall{color}: -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12615467/HIVE-5878.patch {color:red}ERROR:{color} -1 due to 16 failed/errored test(s), 4684 tests executed *Failed tests:* {noformat} org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_create_genericudaf org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_decimal_precision org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_decimal_udf org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_subquery_in org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_subquery_in_having org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_subquery_notin org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_udf3 org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_vectorization_0 org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_vectorization_2 org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_vectorization_not org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_vectorization_pushdown org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_vectorization_short_regress org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_vectorized_mapjoin org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_vectorized_shufflejoin org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_windowing org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_windowing_udaf {noformat} Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/419/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/419/console Messages: {noformat} Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests failed with: TestsFailedException: 16 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12615467 > Hive standard avg UDAF returns double as the return type for some exact input > types > ----------------------------------------------------------------------------------- > > Key: HIVE-5878 > URL: https://issues.apache.org/jira/browse/HIVE-5878 > Project: Hive > Issue Type: Bug > Components: Types, UDF > Affects Versions: 0.12.0 > Reporter: Xuefu Zhang > Assignee: Xuefu Zhang > Attachments: HIVE-5878.patch > > > For standard, no-partial avg result, hive currently returns double as the > result type. > {code} > hive> desc test; > OK > d int None > Time taken: 0.051 seconds, Fetched: 1 row(s) > hive> explain select avg(`d`) from test; > ... > Reduce Operator Tree: > Group By Operator > aggregations: > expr: avg(VALUE._col0) > bucketGroup: false > mode: mergepartial > outputColumnNames: _col0 > Select Operator > expressions: > expr: _col0 > type: double > {code} > However, exact types including integers and decimal should yield exact type. > Here is what MySQL does: > {code} > mysql> desc test; > +-------+--------------+------+-----+---------+-------+ > | Field | Type | Null | Key | Default | Extra | > +-------+--------------+------+-----+---------+-------+ > | i | int(11) | YES | | NULL | | > | b | tinyint(1) | YES | | NULL | | > | d | double | YES | | NULL | | > | s | varchar(5) | YES | | NULL | | > | dd | decimal(5,2) | YES | | NULL | | > +-------+--------------+------+-----+---------+-------+ > mysql> desc test62; > +-------+---------------+------+-----+---------+-------+ > | Field | Type | Null | Key | Default | Extra | > +-------+---------------+------+-----+---------+-------+ > | sum_t | decimal(14,4) | YES | | NULL | | > +-------+---------------+------+-----+---------+-------+ > 1 row in set (0.00 sec) > {code} -- This message was sent by Atlassian JIRA (v6.1#6144)