[ https://issues.apache.org/jira/browse/HIVE-14302?focusedWorklogId=325351&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325351 ]
ASF GitHub Bot logged work on HIVE-14302: ----------------------------------------- Author: ASF GitHub Bot Created on: 08/Oct/19 21:45 Start Date: 08/Oct/19 21:45 Worklog Time Spent: 10m Work Description: mustafaiman commented on pull request #803: HIVE-14302 URL: https://github.com/apache/hive/pull/803#discussion_r332747892 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/MapJoinKey.java ########## @@ -85,6 +84,7 @@ public static MapJoinKey read(Output output, MapJoinObjectSerDeContext context, SUPPORTED_PRIMITIVES.add(PrimitiveCategory.BINARY); SUPPORTED_PRIMITIVES.add(PrimitiveCategory.VARCHAR); SUPPORTED_PRIMITIVES.add(PrimitiveCategory.CHAR); + SUPPORTED_PRIMITIVES.add(PrimitiveCategory.DECIMAL); Review comment: Check is not necessary. During planning, common type is used for join keys. This is true when `hive.cbo.enable` is `true` or `false`. See `FunctionRegistry.getCommonClassForComparison`. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 325351) Time Spent: 40m (was: 0.5h) > Tez: Optimized Hashtable can support DECIMAL keys of same precision > ------------------------------------------------------------------- > > Key: HIVE-14302 > URL: https://issues.apache.org/jira/browse/HIVE-14302 > Project: Hive > Issue Type: Improvement > Components: Tez > Affects Versions: 2.2.0 > Reporter: Gopal Vijayaraghavan > Assignee: Mustafa Iman > Priority: Major > Labels: pull-request-available > Attachments: HIVE-14302.patch > > Time Spent: 40m > Remaining Estimate: 0h > > Decimal support in the optimized hashtable was decided on the basis of the > fact that Decimal(10,1) == Decimal(10, 2) when both contain "1.0" and "1.00". > However, the joins now don't have any issues with decimal precision because > they cast to common. > {code} > create temporary table x (a decimal(10,2), b decimal(10,1)) stored as orc; > insert into x values (1.0, 1.0); > > explain logical select count(1) from x, x x1 where x.a = x1.b; > OK > LOGICAL PLAN: > $hdt$_0:$hdt$_0:x > TableScan (TS_0) > alias: x > filterExpr: (a is not null and true) (type: boolean) > Filter Operator (FIL_18) > predicate: (a is not null and true) (type: boolean) > Select Operator (SEL_2) > expressions: a (type: decimal(10,2)) > outputColumnNames: _col0 > Reduce Output Operator (RS_6) > key expressions: _col0 (type: decimal(11,2)) > sort order: + > Map-reduce partition columns: _col0 (type: decimal(11,2)) > Join Operator (JOIN_8) > condition map: > Inner Join 0 to 1 > keys: > 0 _col0 (type: decimal(11,2)) > 1 _col0 (type: decimal(11,2)) > Group By Operator (GBY_11) > aggregations: count(1) > mode: hash > outputColumnNames: _col0 > {code} > See cast up to Decimal(11, 2) in the plan, which normalizes both sides of the > join to be able to compare HiveDecimal as-is. -- This message was sent by Atlassian Jira (v8.3.4#803005)