From issues-return-168846-archive-asf-public=cust-asf.ponee.io@hive.apache.org Wed Oct 9 16:26:02 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id EB0E6180645 for ; Wed, 9 Oct 2019 18:26:01 +0200 (CEST) Received: (qmail 75932 invoked by uid 500); 9 Oct 2019 16:26:01 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 75919 invoked by uid 99); 9 Oct 2019 16:26:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Oct 2019 16:26:01 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id ABCDFE30AA for ; Wed, 9 Oct 2019 16:26:00 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 2B56B780749 for ; Wed, 9 Oct 2019 16:26:00 +0000 (UTC) Date: Wed, 9 Oct 2019 16:26:00 +0000 (UTC) From: "Mustafa Iman (Jira)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-14302) Tez: Optimized Hashtable can support DECIMAL keys of same precision MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-14302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mustafa Iman updated HIVE-14302: -------------------------------- Status: In Progress (was: Patch Available) > 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.2.patch, HIVE-14302.3.patch, HIVE-14302.4.patch, 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)