Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Reviewed
Description
The query "SELECT count(1) as cnt from src x" has some problems, even though nullgroup*.q passed in tests.
Will check and solve it in this jira.
A wrong plan sometimes can be generated due to some unknow factor:
Wrong plan:
STAGE PLANS: Stage: Stage-1 Map Reduce Alias -> Map Operator Tree: x Select Operator Reduce Output Operator sort order: tag: -1 Reduce Operator Tree: Group By Operator aggregations: expr: count(VALUE._col0) mode: complete Select Operator expressions: expr: _col0 type: bigint File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat Stage: Stage-0 Fetch Operator limit: -1
Without unknow factor, correct plan can be generated:
STAGE PLANS: Stage: Stage-1 Map Reduce Alias -> Map Operator Tree: x Select Operator Group By Operator aggregations: expr: count(1) mode: hash Reduce Output Operator sort order: tag: -1 value expressions: expr: _col0 type: bigint Reduce Operator Tree: Group By Operator aggregations: expr: count(VALUE._col0) mode: mergepartial Select Operator expressions: expr: _col0 type: bigint File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat