From issues-return-181341-archive-asf-public=cust-asf.ponee.io@hive.apache.org Fri Mar 6 17:25:02 2020 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 BCD1B18057A for ; Fri, 6 Mar 2020 18:25:01 +0100 (CET) Received: (qmail 63440 invoked by uid 500); 6 Mar 2020 17:25: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 63430 invoked by uid 99); 6 Mar 2020 17:25: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; Fri, 06 Mar 2020 17:25: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 87435E0F34 for ; Fri, 6 Mar 2020 17:25: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 0856D780369 for ; Fri, 6 Mar 2020 17:25:00 +0000 (UTC) Date: Fri, 6 Mar 2020 17:25:00 +0000 (UTC) From: "David Mollitor (Jira)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (HIVE-22993) Include Bloom Filter in Column Statistics to Better Estimate nDV 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-22993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17053607#comment-17053607 ] David Mollitor edited comment on HIVE-22993 at 3/6/20, 5:24 PM: ---------------------------------------------------------------- [~gopalv] Thanks. Do you know what JIRA introduced this change? I have been testing on HDP 3.1 Edit: Can this BIT_VECTOR field be applied to this request for better stats on INSERT? was (Author: belugabehr): [~gopalv] Thanks. Do you know what JIRA introduced this change? I have been testing on HDP 3.1 > Include Bloom Filter in Column Statistics to Better Estimate nDV > ---------------------------------------------------------------- > > Key: HIVE-22993 > URL: https://issues.apache.org/jira/browse/HIVE-22993 > Project: Hive > Issue Type: Improvement > Components: CBO, Statistics > Reporter: David Mollitor > Priority: Major > > When performing an INSERT statement, Hive has no way to determine the number of distinct values since the distinct values themselves are not recorded. > {code:sql} > create table test_mm(`id` int, `my_dt` date); > insert into test_mm values (1, "2018-10-01"), (2, "2018-10-01"), (3, "2018-10-01"), > (4, "2017-10-01"), (5, "2017-10-01"), (6, "2017-10-01"), > (7, "2010-10-01"), (8, "2010-10-01"), (9, "2010-10-01"), > (10, "1998-10-01"), (11, "1998-10-01"), (12, "1998-10-01"); > DESCRIBE FORMATTED test_mm my_dt; > -- distinct_count: 4 > insert into test_mm values (13, "2030-10-01"), (14, "2030-10-01"), (15, "2030-10-01"); > DESCRIBE FORMATTED test_mm my_dt; > -- distinct_count: 4 > {code} > The first INSERT statement sees that there are 0 records, so it makes sense that any distinct values marked in the statistics. However, for the second INSERT, Hive has no idea if "2030-10-01" is distinct, so the distinct_count is unchanged. By introducing a bloom filter for column statistics, the second INSERT may be able to determine that "2030-10-01" is indeed unique and update the distinct_count accordingly. -- This message was sent by Atlassian Jira (v8.3.4#803005)