Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6DFB1200D3E for ; Thu, 16 Nov 2017 13:29:11 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6C753160BE6; Thu, 16 Nov 2017 12:29:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 655A6160BE5 for ; Thu, 16 Nov 2017 13:29:10 +0100 (CET) Received: (qmail 49747 invoked by uid 500); 16 Nov 2017 12:29:09 -0000 Mailing-List: contact issues-help@carbondata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@carbondata.apache.org Delivered-To: mailing list issues@carbondata.apache.org Received: (qmail 49738 invoked by uid 99); 16 Nov 2017 12:29:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2017 12:29:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id CF84B180791 for ; Thu, 16 Nov 2017 12:29:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 204ZL0j2euz5 for ; Thu, 16 Nov 2017 12:29:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 340565FD47 for ; Thu, 16 Nov 2017 12:29:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 36F2CE257B for ; Thu, 16 Nov 2017 12:29:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 51F32240F2 for ; Thu, 16 Nov 2017 12:29:00 +0000 (UTC) Date: Thu, 16 Nov 2017 12:29:00 +0000 (UTC) From: "Ramakrishna S (JIRA)" To: issues@carbondata.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CARBONDATA-1737) Carbon1.3.0-Pre-AggregateTable - Pre-aggregate table loads partially when segment filter is set on the main table MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 16 Nov 2017 12:29:11 -0000 [ https://issues.apache.org/jira/browse/CARBONDATA-1737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ramakrishna S updated CARBONDATA-1737: -------------------------------------- Description: 1. Create a table create table if not exists lineitem2(L_SHIPDATE string,L_SHIPMODE string,L_SHIPINSTRUCT string,L_RETURNFLAG string,L_RECEIPTDATE string,L_ORDERKEY string,L_PARTKEY string,L_SUPPKEY string,L_LINENUMBER int,L_QUANTITY double,L_EXTENDEDPRICE double,L_DISCOUNT double,L_TAX double,L_LINESTATUS string,L_COMMITDATE string,L_COMMENT string) STORED BY 'org.apache.carbondata.format' TBLPROPERTIES ('table_blocksize'='128','NO_INVERTED_INDEX'='L_SHIPDATE,L_SHIPMODE,L_SHIPINSTRUCT,L_RETURNFLAG,L_RECEIPTDATE,L_ORDERKEY,L_PARTKEY,L_SUPPKEY','sort_columns'=''); 2. Load 2 times to create 2 segments load data inpath "hdfs://hacluster/user/test/lineitem.tbl.5" into table lineitem2 options('DELIMITER'='|','FILEHEADER'='L_ORDERKEY,L_PARTKEY,L_SUPPKEY,L_LINENUMBER,L_QUANTITY,L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT'); 3. Check the table content without setting any filter: select l_returnflag,l_linestatus,sum(l_quantity),sum(l_extendedprice) from lineitem2 group by l_returnflag, l_linestatus; +---------------+---------------+------------------+------------------------+--+ | l_returnflag | l_linestatus | sum(l_quantity) | sum(l_extendedprice) | +---------------+---------------+------------------+------------------------+--+ | N | F | 327800.0 | 4.913876776200004E8 | | A | F | 1.263625E7 | 1.893851542524009E10 | | N | O | 2.5398626E7 | 3.810981608977967E10 | | R | F | 1.2643878E7 | 1.8948524305619976E10 | +---------------+---------------+------------------+------------------------+--+ 4. Set segment filter on the main table: set carbon.input.segments.test_db1.lineitem2=1; +-------------------------------------------+--------+--+ | key | value | +-------------------------------------------+--------+--+ | carbon.input.segments.test_db1.lineitem2 | 1 | +-------------------------------------------+--------+--+ 5. Create pre-aggregate table create datamap agr_lineitem2 ON TABLE lineitem2 USING "org.apache.carbondata.datamap.AggregateDataMapHandler" as select L_RETURNFLAG,L_LINESTATUS,sum(L_QUANTITY),sum(L_EXTENDEDPRICE) from lineitem2 group by L_RETURNFLAG, L_LINESTATUS; 6. Check table content: select l_returnflag,l_linestatus,sum(l_quantity),sum(l_extendedprice) from lineitem2 group by l_returnflag, l_linestatus; +---------------+---------------+------------------+------------------------+--+ | l_returnflag | l_linestatus | sum(l_quantity) | sum(l_extendedprice) | +---------------+---------------+------------------+------------------------+--+ | N | F | 163900.0 | 2.4569383881000024E8 | | A | F | 6318125.0 | 9.469257712620043E9 | | N | O | 1.2699313E7 | 1.9054908044889835E10 | | R | F | 6321939.0 | 9.474262152809986E9 | +---------------+---------------+------------------+------------------------+--+ 7. remove the filter on segment 0: jdbc:hive2://10.18.98.48:23040> reset; 8. Check the table conent: select l_returnflag,l_linestatus,sum(l_quantity),sum(l_extendedprice) from lineitem2 group by l_returnflag, l_linestatus; +---------------+---------------+------------------+------------------------+--+ | l_returnflag | l_linestatus | sum(l_quantity) | sum(l_extendedprice) | +---------------+---------------+------------------+------------------------+--+ | N | F | 163900.0 | 2.4569383881000024E8 | | A | F | 6318125.0 | 9.469257712620043E9 | | N | O | 1.2699313E7 | 1.9054908044889835E10 | | R | F | 6321939.0 | 9.474262152809986E9 | +---------------+---------------+------------------+------------------------+--+ 4 rows selected (2.341 seconds) 9. Load one more time: 10. Check table content select l_returnflag,l_linestatus,sum(l_quantity),sum(l_extendedprice) from lineitem2 group by l_returnflag, l_linestatus; +---------------+---------------+------------------+------------------------+--+ | l_returnflag | l_linestatus | sum(l_quantity) | sum(l_extendedprice) | +---------------+---------------+------------------+------------------------+--+ | N | F | 327800.0 | 4.913876776200005E8 | | A | F | 1.263625E7 | 1.8938515425240086E10 | | N | O | 2.5398626E7 | 3.810981608977967E10 | | R | F | 1.2643878E7 | 1.8948524305619972E10 | +---------------+---------------+------------------+------------------------+--+ 4 rows selected (0.936 seconds) *+Expected:+*: one of these should have been the behavour: 1.Ignore segment filter and use all segments. During query run if segment filter is set then ignore the pre-aggr table and fetch data from main table. (*Preferred*) Or 2. Reject pre-aggregate creation when segment filter is set or vis-a-versa. *+Actual:+* Partial data returned was: 1. Create a table create table if not exists lineitem1(L_SHIPDATE string,L_SHIPMODE string,L_SHIPINSTRUCT string,L_RETURNFLAG string,L_RECEIPTDATE string,L_ORDERKEY string,L_PARTKEY string,L_SUPPKEY string,L_LINENUMBER int,L_QUANTITY double,L_EXTENDEDPRICE double,L_DISCOUNT double,L_TAX double,L_LINESTATUS string,L_COMMITDATE string,L_COMMENT string) STORED BY 'org.apache.carbondata.format' TBLPROPERTIES ('table_blocksize'='128','NO_INVERTED_INDEX'='L_SHIPDATE,L_SHIPMODE,L_SHIPINSTRUCT,L_RETURNFLAG,L_RECEIPTDATE,L_ORDERKEY,L_PARTKEY,L_SUPPKEY','sort_columns'=''); 2. Run load : load data inpath "hdfs://hacluster/user/test/lineitem.tbl.1" into table lineitem1 options('DELIMITER'='|','FILEHEADER'='L_ORDERKEY,L_PARTKEY,L_SUPPKEY,L_LINENUMBER,L_QUANTITY,L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT'); 3. create pre-agg table create datamap agr_lineitem3 ON TABLE lineitem3 USING "org.apache.carbondata.datamap.AggregateDataMapHandler" as select L_RETURNFLAG,L_LINESTATUS,sum(L_QUANTITY),sum(L_EXTENDEDPRICE) from lineitem3 group by L_RETURNFLAG, L_LINESTATUS; 3. Check table content using aggregate query: select l_returnflag,l_linestatus,sum(l_quantity),sum(l_extendedprice) from lineitem3 group by l_returnflag, l_linestatus; +---------------+---------------+------------------+------------------------+--+ | l_returnflag | l_linestatus | sum(l_quantity) | sum(l_extendedprice) | +---------------+---------------+------------------+------------------------+--+ | N | F | 4913382.0 | 7.369901176949993E9 | | A | F | 1.88818373E8 | 2.8310705145736383E11 | | N | O | 3.82400594E8 | 5.734650756707479E11 | | R | F | 1.88960009E8 | 2.833523780876951E11 | +---------------+---------------+------------------+------------------------+--+ 4 rows selected (1.568 seconds) 4. Load one more time: load data inpath "hdfs://hacluster/user/test/lineitem.tbl.1" into table lineitem1 options('DELIMITER'='|','FILEHEADER'='L_ORDERKEY,L_PARTKEY,L_SUPPKEY,L_LINENUMBER,L_QUANTITY,L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT'); 5. Check table content using aggregate query: select l_returnflag,l_linestatus,sum(l_quantity),sum(l_extendedprice) from lineitem3 group by l_returnflag, l_linestatus; +---------------+---------------+------------------+------------------------+--+ | l_returnflag | l_linestatus | sum(l_quantity) | sum(l_extendedprice) | +---------------+---------------+------------------+------------------------+--+ | N | F | 9826764.0 | 1.4739802353899986E10 | | A | F | 3.77636746E8 | 5.662141029147278E11 | | N | O | 7.64801188E8 | 1.1469301513414958E12 | | R | F | 3.77920018E8 | 5.667047561753901E11 | +---------------+---------------+------------------+------------------------+--+ 6. Set query from segment 1: 0: jdbc:hive2://10.18.98.48:23040> set carbon.input.segments.test_db1.lilneitem1=1; +--------------------------------------------+--------+--+ | key | value | +--------------------------------------------+--------+--+ | carbon.input.segments.test_db1.lilneitem1 | 1 | +--------------------------------------------+--------+--+ 7. Check table content using aggregate query: select l_returnflag,l_linestatus,sum(l_quantity),sum(l_extendedprice) from lineitem3 group by l_returnflag, l_linestatus; *+Expected+*: It should return the values from segment 1 alone. *+Actual :+* : It returns values from both segments +---------------+---------------+------------------+------------------------+--+ | l_returnflag | l_linestatus | sum(l_quantity) | sum(l_extendedprice) | +---------------+---------------+------------------+------------------------+--+ | N | F | 9826764.0 | 1.4739802353899986E10 | | A | F | 3.77636746E8 | 5.662141029147278E11 | | N | O | 7.64801188E8 | 1.1469301513414958E12 | | R | F | 3.77920018E8 | 5.667047561753901E11 | +---------------+---------------+------------------+------------------------+--+ > Carbon1.3.0-Pre-AggregateTable - Pre-aggregate table loads partially when segment filter is set on the main table > ----------------------------------------------------------------------------------------------------------------- > > Key: CARBONDATA-1737 > URL: https://issues.apache.org/jira/browse/CARBONDATA-1737 > Project: CarbonData > Issue Type: Bug > Components: data-load > Affects Versions: 1.3.0 > Environment: Test - 3 node ant cluster > Reporter: Ramakrishna S > Labels: DFX > Fix For: 1.3.0 > > > 1. Create a table > create table if not exists lineitem2(L_SHIPDATE string,L_SHIPMODE string,L_SHIPINSTRUCT string,L_RETURNFLAG string,L_RECEIPTDATE string,L_ORDERKEY string,L_PARTKEY string,L_SUPPKEY string,L_LINENUMBER int,L_QUANTITY double,L_EXTENDEDPRICE double,L_DISCOUNT double,L_TAX double,L_LINESTATUS string,L_COMMITDATE string,L_COMMENT string) STORED BY 'org.apache.carbondata.format' TBLPROPERTIES ('table_blocksize'='128','NO_INVERTED_INDEX'='L_SHIPDATE,L_SHIPMODE,L_SHIPINSTRUCT,L_RETURNFLAG,L_RECEIPTDATE,L_ORDERKEY,L_PARTKEY,L_SUPPKEY','sort_columns'=''); > 2. Load 2 times to create 2 segments > load data inpath "hdfs://hacluster/user/test/lineitem.tbl.5" into table lineitem2 options('DELIMITER'='|','FILEHEADER'='L_ORDERKEY,L_PARTKEY,L_SUPPKEY,L_LINENUMBER,L_QUANTITY,L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT'); > 3. Check the table content without setting any filter: > select l_returnflag,l_linestatus,sum(l_quantity),sum(l_extendedprice) from lineitem2 group by l_returnflag, l_linestatus; > +---------------+---------------+------------------+------------------------+--+ > | l_returnflag | l_linestatus | sum(l_quantity) | sum(l_extendedprice) | > +---------------+---------------+------------------+------------------------+--+ > | N | F | 327800.0 | 4.913876776200004E8 | > | A | F | 1.263625E7 | 1.893851542524009E10 | > | N | O | 2.5398626E7 | 3.810981608977967E10 | > | R | F | 1.2643878E7 | 1.8948524305619976E10 | > +---------------+---------------+------------------+------------------------+--+ > 4. Set segment filter on the main table: > set carbon.input.segments.test_db1.lineitem2=1; > +-------------------------------------------+--------+--+ > | key | value | > +-------------------------------------------+--------+--+ > | carbon.input.segments.test_db1.lineitem2 | 1 | > +-------------------------------------------+--------+--+ > 5. Create pre-aggregate table > create datamap agr_lineitem2 ON TABLE lineitem2 USING "org.apache.carbondata.datamap.AggregateDataMapHandler" as select L_RETURNFLAG,L_LINESTATUS,sum(L_QUANTITY),sum(L_EXTENDEDPRICE) from lineitem2 group by L_RETURNFLAG, L_LINESTATUS; > 6. Check table content: > select l_returnflag,l_linestatus,sum(l_quantity),sum(l_extendedprice) from lineitem2 group by l_returnflag, l_linestatus; > +---------------+---------------+------------------+------------------------+--+ > | l_returnflag | l_linestatus | sum(l_quantity) | sum(l_extendedprice) | > +---------------+---------------+------------------+------------------------+--+ > | N | F | 163900.0 | 2.4569383881000024E8 | > | A | F | 6318125.0 | 9.469257712620043E9 | > | N | O | 1.2699313E7 | 1.9054908044889835E10 | > | R | F | 6321939.0 | 9.474262152809986E9 | > +---------------+---------------+------------------+------------------------+--+ > 7. remove the filter on segment > 0: jdbc:hive2://10.18.98.48:23040> reset; > 8. Check the table conent: > select l_returnflag,l_linestatus,sum(l_quantity),sum(l_extendedprice) from lineitem2 group by l_returnflag, l_linestatus; > +---------------+---------------+------------------+------------------------+--+ > | l_returnflag | l_linestatus | sum(l_quantity) | sum(l_extendedprice) | > +---------------+---------------+------------------+------------------------+--+ > | N | F | 163900.0 | 2.4569383881000024E8 | > | A | F | 6318125.0 | 9.469257712620043E9 | > | N | O | 1.2699313E7 | 1.9054908044889835E10 | > | R | F | 6321939.0 | 9.474262152809986E9 | > +---------------+---------------+------------------+------------------------+--+ > 4 rows selected (2.341 seconds) > 9. Load one more time: > 10. Check table content > select l_returnflag,l_linestatus,sum(l_quantity),sum(l_extendedprice) from lineitem2 group by l_returnflag, l_linestatus; > +---------------+---------------+------------------+------------------------+--+ > | l_returnflag | l_linestatus | sum(l_quantity) | sum(l_extendedprice) | > +---------------+---------------+------------------+------------------------+--+ > | N | F | 327800.0 | 4.913876776200005E8 | > | A | F | 1.263625E7 | 1.8938515425240086E10 | > | N | O | 2.5398626E7 | 3.810981608977967E10 | > | R | F | 1.2643878E7 | 1.8948524305619972E10 | > +---------------+---------------+------------------+------------------------+--+ > 4 rows selected (0.936 seconds) > *+Expected:+*: one of these should have been the behavour: > 1.Ignore segment filter and use all segments. During query run if segment filter is set then ignore the pre-aggr table and fetch data from main table. (*Preferred*) > Or > 2. Reject pre-aggregate creation when segment filter is set or vis-a-versa. > *+Actual:+* Partial data returned -- This message was sent by Atlassian JIRA (v6.4.14#64029)