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 C5E0C200BD3 for ; Tue, 6 Dec 2016 20:09:03 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id C468A160B17; Tue, 6 Dec 2016 19:09:03 +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 C78D3160B1B for ; Tue, 6 Dec 2016 20:09:01 +0100 (CET) Received: (qmail 38598 invoked by uid 500); 6 Dec 2016 19:09:01 -0000 Mailing-List: contact commits-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@impala.incubator.apache.org Delivered-To: mailing list commits@impala.incubator.apache.org Received: (qmail 38588 invoked by uid 99); 6 Dec 2016 19:09:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2016 19:09:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 6FDF71AB6EA for ; Tue, 6 Dec 2016 19:09:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.218 X-Spam-Level: X-Spam-Status: No, score=-6.218 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id pP-dVOfVtxOO for ; Tue, 6 Dec 2016 19:08:48 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id CC6A15FD15 for ; Tue, 6 Dec 2016 19:08:45 +0000 (UTC) Received: (qmail 35894 invoked by uid 99); 6 Dec 2016 19:07:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2016 19:07:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 13042F1712; Tue, 6 Dec 2016 19:07:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kwho@apache.org To: commits@impala.incubator.apache.org Date: Tue, 06 Dec 2016 19:07:34 -0000 Message-Id: <4e4e23ed64c24a508aa6d9b4903d39cd@git.apache.org> In-Reply-To: <942afba1375a4502b70d66cc7f8be541@git.apache.org> References: <942afba1375a4502b70d66cc7f8be541@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [6/8] incubator-impala git commit: IMPALA-4561: Replace DISTRIBUTE BY with PARTITION BY in CREATE TABLE archived-at: Tue, 06 Dec 2016 19:09:04 -0000 http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/fe/src/test/java/org/apache/impala/analysis/ParserTest.java ---------------------------------------------------------------------- diff --git a/fe/src/test/java/org/apache/impala/analysis/ParserTest.java b/fe/src/test/java/org/apache/impala/analysis/ParserTest.java index 6833ee9..a73adf3 100644 --- a/fe/src/test/java/org/apache/impala/analysis/ParserTest.java +++ b/fe/src/test/java/org/apache/impala/analysis/ParserTest.java @@ -2445,52 +2445,52 @@ public class ParserTest extends FrontendTestBase { // Flexible partitioning - ParsesOk("CREATE TABLE Foo (i int) DISTRIBUTE BY HASH(i) INTO 4 BUCKETS"); - ParsesOk("CREATE TABLE Foo (i int) DISTRIBUTE BY HASH(i) INTO 4 BUCKETS, " + + ParsesOk("CREATE TABLE Foo (i int) PARTITION BY HASH(i) INTO 4 BUCKETS"); + ParsesOk("CREATE TABLE Foo (i int) PARTITION BY HASH(i) INTO 4 BUCKETS, " + "HASH(a) INTO 2 BUCKETS"); - ParsesOk("CREATE TABLE Foo (i int) DISTRIBUTE BY HASH INTO 4 BUCKETS"); - ParsesOk("CREATE TABLE Foo (i int, k int) DISTRIBUTE BY HASH INTO 4 BUCKETS," + + ParsesOk("CREATE TABLE Foo (i int) PARTITION BY HASH INTO 4 BUCKETS"); + ParsesOk("CREATE TABLE Foo (i int, k int) PARTITION BY HASH INTO 4 BUCKETS," + " HASH(k) INTO 4 BUCKETS"); - ParserError("CREATE TABLE Foo (i int) DISTRIBUTE BY HASH(i)"); - ParserError("CREATE EXTERNAL TABLE Foo DISTRIBUTE BY HASH INTO 4 BUCKETS"); + ParserError("CREATE TABLE Foo (i int) PARTITION BY HASH(i)"); + ParserError("CREATE EXTERNAL TABLE Foo PARTITION BY HASH INTO 4 BUCKETS"); // Range partitioning - ParsesOk("CREATE TABLE Foo (i int) DISTRIBUTE BY RANGE (PARTITION VALUE = 10)"); - ParsesOk("CREATE TABLE Foo (i int) DISTRIBUTE BY RANGE(i) " + + ParsesOk("CREATE TABLE Foo (i int) PARTITION BY RANGE (PARTITION VALUE = 10)"); + ParsesOk("CREATE TABLE Foo (i int) PARTITION BY RANGE(i) " + "(PARTITION 1 <= VALUES < 10, PARTITION 10 <= VALUES < 20, " + "PARTITION 21 < VALUES <= 30, PARTITION VALUE = 50)"); - ParsesOk("CREATE TABLE Foo (a int) DISTRIBUTE BY RANGE(a) " + + ParsesOk("CREATE TABLE Foo (a int) PARTITION BY RANGE(a) " + "(PARTITION 10 <= VALUES)"); - ParsesOk("CREATE TABLE Foo (a int) DISTRIBUTE BY RANGE(a) " + + ParsesOk("CREATE TABLE Foo (a int) PARTITION BY RANGE(a) " + "(PARTITION VALUES < 10)"); - ParsesOk("CREATE TABLE Foo (a int) DISTRIBUTE BY RANGE (a) " + + ParsesOk("CREATE TABLE Foo (a int) PARTITION BY RANGE (a) " + "(PARTITION VALUE = 10, PARTITION VALUE = 20)"); - ParsesOk("CREATE TABLE Foo (a int) DISTRIBUTE BY RANGE(a) " + + ParsesOk("CREATE TABLE Foo (a int) PARTITION BY RANGE(a) " + "(PARTITION VALUES <= 10, PARTITION VALUE = 20)"); - ParsesOk("CREATE TABLE Foo (a int, b int) DISTRIBUTE BY RANGE(a, b) " + + ParsesOk("CREATE TABLE Foo (a int, b int) PARTITION BY RANGE(a, b) " + "(PARTITION VALUE = (2001, 1), PARTITION VALUE = (2001, 2), " + "PARTITION VALUE = (2002, 1))"); - ParsesOk("CREATE TABLE Foo (a int, b string) DISTRIBUTE BY " + + ParsesOk("CREATE TABLE Foo (a int, b string) PARTITION BY " + "HASH (a) INTO 3 BUCKETS, RANGE (a, b) (PARTITION VALUE = (1, 'abc'), " + "PARTITION VALUE = (2, 'def'))"); - ParsesOk("CREATE TABLE Foo (a int) DISTRIBUTE BY RANGE (a) " + + ParsesOk("CREATE TABLE Foo (a int) PARTITION BY RANGE (a) " + "(PARTITION VALUE = 1 + 1) STORED AS KUDU"); - ParsesOk("CREATE TABLE Foo (a int) DISTRIBUTE BY RANGE (a) " + + ParsesOk("CREATE TABLE Foo (a int) PARTITION BY RANGE (a) " + "(PARTITION 1 + 1 < VALUES) STORED AS KUDU"); - ParsesOk("CREATE TABLE Foo (a int, b int) DISTRIBUTE BY RANGE (a) " + + ParsesOk("CREATE TABLE Foo (a int, b int) PARTITION BY RANGE (a) " + "(PARTITION b < VALUES <= a) STORED AS KUDU"); - ParsesOk("CREATE TABLE Foo (a int) DISTRIBUTE BY RANGE (a) " + + ParsesOk("CREATE TABLE Foo (a int) PARTITION BY RANGE (a) " + "(PARTITION now() <= VALUES, PARTITION VALUE = add_months(now(), 2)) " + "STORED AS KUDU"); - ParserError("CREATE TABLE Foo (a int) DISTRIBUTE BY RANGE (a) ()"); - ParserError("CREATE TABLE Foo (a int) DISTRIBUTE BY HASH (a) INTO 4 BUCKETS, " + + ParserError("CREATE TABLE Foo (a int) PARTITION BY RANGE (a) ()"); + ParserError("CREATE TABLE Foo (a int) PARTITION BY HASH (a) INTO 4 BUCKETS, " + "RANGE (a) (PARTITION VALUE = 10), RANGE (a) (PARTITION VALUES < 10)"); - ParserError("CREATE TABLE Foo (a int) DISTRIBUTE BY RANGE (a) " + + ParserError("CREATE TABLE Foo (a int) PARTITION BY RANGE (a) " + "(PARTITION VALUE = 10), HASH (a) INTO 3 BUCKETS"); - ParserError("CREATE TABLE Foo (a int) DISTRIBUTE BY RANGE (a) " + + ParserError("CREATE TABLE Foo (a int) PARTITION BY RANGE (a) " + "(PARTITION VALUES = 10) STORED AS KUDU"); - ParserError("CREATE TABLE Foo (a int) DISTRIBUTE BY RANGE (a) " + + ParserError("CREATE TABLE Foo (a int) PARTITION BY RANGE (a) " + "(PARTITION 10 < VALUE < 20) STORED AS KUDU"); // Column options for Kudu tables @@ -2676,9 +2676,9 @@ public class ParserTest extends FrontendTestBase { ParsesOk("CREATE TABLE Foo ROW FORMAT DELIMITED STORED AS PARQUETFILE AS SELECT 1"); ParsesOk("CREATE TABLE Foo TBLPROPERTIES ('a'='b', 'c'='d') AS SELECT * from bar"); ParsesOk("CREATE TABLE Foo PRIMARY KEY (a, b) AS SELECT * from bar"); - ParsesOk("CREATE TABLE Foo PRIMARY KEY (a, b) DISTRIBUTE BY HASH INTO 2 BUCKETS " + + ParsesOk("CREATE TABLE Foo PRIMARY KEY (a, b) PARTITION BY HASH INTO 2 BUCKETS " + "AS SELECT * from bar"); - ParsesOk("CREATE TABLE Foo PRIMARY KEY (a, b) DISTRIBUTE BY HASH (b) INTO 2 " + + ParsesOk("CREATE TABLE Foo PRIMARY KEY (a, b) PARTITION BY HASH (b) INTO 2 " + "BUCKETS AS SELECT * from bar"); // With clause works @@ -2708,12 +2708,12 @@ public class ParserTest extends FrontendTestBase { ParserError("CREATE TABLE Foo PARTITIONED BY (a, b=2) AS SELECT * from Bar"); // Flexible partitioning - ParsesOk("CREATE TABLE Foo PRIMARY KEY (i) DISTRIBUTE BY HASH(i) INTO 4 BUCKETS AS " + + ParsesOk("CREATE TABLE Foo PRIMARY KEY (i) PARTITION BY HASH(i) INTO 4 BUCKETS AS " + "SELECT 1"); - ParserError("CREATE TABLE Foo DISTRIBUTE BY HASH(i) INTO 4 BUCKETS AS SELECT 1"); - ParsesOk("CREATE TABLE Foo PRIMARY KEY (a) DISTRIBUTE BY HASH(a) INTO 4 BUCKETS " + + ParserError("CREATE TABLE Foo PARTITION BY HASH(i) INTO 4 BUCKETS AS SELECT 1"); + ParsesOk("CREATE TABLE Foo PRIMARY KEY (a) PARTITION BY HASH(a) INTO 4 BUCKETS " + "TBLPROPERTIES ('a'='b', 'c'='d') AS SELECT * from bar"); - ParsesOk("CREATE TABLE Foo PRIMARY KEY (a) DISTRIBUTE BY RANGE(a) " + + ParsesOk("CREATE TABLE Foo PRIMARY KEY (a) PARTITION BY RANGE(a) " + "(PARTITION 1 < VALUES < 10, PARTITION 10 <= VALUES < 20, PARTITION VALUE = 30) " + "STORED AS KUDU AS SELECT * FROM Bar"); } http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/bin/generate-schema-statements.py ---------------------------------------------------------------------- diff --git a/testdata/bin/generate-schema-statements.py b/testdata/bin/generate-schema-statements.py index 1fe6a01..5d5da1b 100755 --- a/testdata/bin/generate-schema-statements.py +++ b/testdata/bin/generate-schema-statements.py @@ -223,7 +223,7 @@ def build_table_template(file_format, columns, partition_columns, row_format, elif file_format == 'kudu': # Use partitioned_by to set a trivial hash distribution assert not partitioned_by, "Kudu table shouldn't have partition cols defined" - partitioned_by = "distribute by hash into 3 buckets" + partitioned_by = "partition by hash into 3 buckets" # Fetch KUDU host and port from environment kudu_master = os.getenv("KUDU_MASTER_ADDRESS", "127.0.0.1") http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/datasets/functional/functional_schema_template.sql ---------------------------------------------------------------------- diff --git a/testdata/datasets/functional/functional_schema_template.sql b/testdata/datasets/functional/functional_schema_template.sql index be7a6ac..d6859eb 100644 --- a/testdata/datasets/functional/functional_schema_template.sql +++ b/testdata/datasets/functional/functional_schema_template.sql @@ -93,7 +93,7 @@ CREATE TABLE {db_name}{db_suffix}.{table_name} ( year INT, month INT ) -DISTRIBUTE BY HASH (id) INTO 3 BUCKETS STORED AS KUDU; +PARTITION BY HASH (id) INTO 3 BUCKETS STORED AS KUDU; ---- DEPENDENT_LOAD_KUDU INSERT into TABLE {db_name}{db_suffix}.{table_name} SELECT id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, @@ -171,7 +171,7 @@ CREATE TABLE {db_name}{db_suffix}.{table_name} ( year INT, month INT ) -DISTRIBUTE BY HASH (id) INTO 3 BUCKETS STORED AS KUDU; +PARTITION BY HASH (id) INTO 3 BUCKETS STORED AS KUDU; ---- DEPENDENT_LOAD_KUDU INSERT into TABLE {db_name}{db_suffix}.{table_name} SELECT id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, @@ -230,7 +230,7 @@ CREATE TABLE {db_name}{db_suffix}.{table_name} ( year INT, month INT ) -DISTRIBUTE BY HASH (id) INTO 3 BUCKETS STORED AS KUDU; +PARTITION BY HASH (id) INTO 3 BUCKETS STORED AS KUDU; ---- DEPENDENT_LOAD_KUDU INSERT INTO TABLE {db_name}{db_suffix}.{table_name} SELECT id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, @@ -566,7 +566,7 @@ CREATE TABLE {db_name}{db_suffix}.{table_name}_idx ( month INT NULL, day INT NULL ) -DISTRIBUTE BY HASH (kudu_idx) INTO 3 BUCKETS STORED AS KUDU; +PARTITION BY HASH (kudu_idx) INTO 3 BUCKETS STORED AS KUDU; CREATE VIEW {db_name}{db_suffix}.{table_name} AS SELECT id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col, year, month, day @@ -645,7 +645,7 @@ CREATE TABLE {db_name}{db_suffix}.{table_name} ( month INT, day INT ) -DISTRIBUTE BY HASH (id) INTO 3 BUCKETS STORED AS KUDU; +PARTITION BY HASH (id) INTO 3 BUCKETS STORED AS KUDU; ---- DEPENDENT_LOAD_KUDU INSERT into TABLE {db_name}{db_suffix}.{table_name} SELECT id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, @@ -766,7 +766,7 @@ create table {db_name}{db_suffix}.{table_name} ( name string null, zip int null ) -distribute by range(id) (partition values <= 1003, partition 1003 < values <= 1007, +partition by range(id) (partition values <= 1003, partition 1003 < values <= 1007, partition 1007 < values) stored as kudu; ==== ---- DATASET @@ -790,7 +790,7 @@ create table {db_name}{db_suffix}.{table_name} ( name string, zip int ) -distribute by range(id) (partition values <= 1003, partition 1003 < values <= 1007, +partition by range(id) (partition values <= 1003, partition 1003 < values <= 1007, partition 1007 < values) stored as kudu; ==== ---- DATASET @@ -817,7 +817,7 @@ create table {db_name}{db_suffix}.{table_name} ( alltypes_id int, primary key (test_id, test_name, test_zip, alltypes_id) ) -distribute by range(test_id) (partition values <= 1003, partition 1003 < values <= 1007, +partition by range(test_id) (partition values <= 1003, partition 1003 < values <= 1007, partition 1007 < values) stored as kudu; ==== ---- DATASET @@ -1157,7 +1157,7 @@ CREATE TABLE {db_name}{db_suffix}.{table_name} ( field STRING PRIMARY KEY, f2 INT ) -DISTRIBUTE BY HASH (field) INTO 3 BUCKETS STORED AS KUDU; +PARTITION BY HASH (field) INTO 3 BUCKETS STORED AS KUDU; ==== ---- DATASET functional @@ -1264,7 +1264,7 @@ create table {db_name}{db_suffix}.{table_name} ( a string primary key, b string ) -distribute by range(a) (partition values <= 'b', partition 'b' < values <= 'd', +partition by range(a) (partition values <= 'b', partition 'b' < values <= 'd', partition 'd' < values) stored as kudu; ==== ---- DATASET @@ -1284,7 +1284,7 @@ DROP TABLE IF EXISTS {db_name}{db_suffix}.{table_name}; create table {db_name}{db_suffix}.{table_name} ( int_col int primary key ) -distribute by range(int_col) (partition values <= 2, partition 2 < values <= 4, +partition by range(int_col) (partition values <= 2, partition 2 < values <= 4, partition 4 < values <= 6, partition 6 < values <= 8, partition 8 < values) stored as kudu; ==== @@ -1313,7 +1313,7 @@ create table {db_name}{db_suffix}.{table_name} ( a string primary key, b string null, c string null, d int null, e double null, f string null, g string null ) -distribute by hash(a) into 3 buckets stored as kudu; +partition by hash(a) into 3 buckets stored as kudu; ==== ---- DATASET functional @@ -1340,7 +1340,7 @@ create table {db_name}{db_suffix}.{table_name} ( a string primary key, b string null, c string null, d int null, e double null, f string null, g string null ) -distribute by hash(a) into 3 buckets stored as kudu; +partition by hash(a) into 3 buckets stored as kudu; ==== ---- DATASET functional @@ -1418,7 +1418,7 @@ create table {db_name}{db_suffix}.{table_name} ( description1 string null, description2 string null, income int null) -distribute by range(id) +partition by range(id) (partition values <= '8600000US01475', partition '8600000US01475' < values <= '8600000US63121', partition '8600000US63121' < values <= '8600000US84712', http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/datasets/tpcds/tpcds_kudu_template.sql ---------------------------------------------------------------------- diff --git a/testdata/datasets/tpcds/tpcds_kudu_template.sql b/testdata/datasets/tpcds/tpcds_kudu_template.sql index 6c0b994..021fe87 100644 --- a/testdata/datasets/tpcds/tpcds_kudu_template.sql +++ b/testdata/datasets/tpcds/tpcds_kudu_template.sql @@ -49,7 +49,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.store_sales ( ss_net_profit DOUBLE, PRIMARY KEY (ss_ticket_number, ss_item_sk) ) -DISTRIBUTE BY HASH (ss_ticket_number,ss_item_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (ss_ticket_number,ss_item_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses' = '{kudu_master}:7051'); @@ -117,7 +117,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.web_sales ( ws_net_profit DOUBLE, PRIMARY KEY (ws_order_number, ws_item_sk) ) -DISTRIBUTE BY HASH (ws_order_number,ws_item_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (ws_order_number,ws_item_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses' = '{kudu_master}:7051'); @@ -197,7 +197,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.catalog_sales ( cs_net_profit DOUBLE, PRIMARY KEY (cs_order_number, cs_item_sk) ) -DISTRIBUTE BY HASH (cs_order_number,cs_item_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (cs_order_number,cs_item_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses' = '{kudu_master}:7051'); @@ -263,7 +263,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.store_returns ( sr_net_loss DOUBLE, PRIMARY KEY (sr_ticket_number, sr_item_sk) ) -DISTRIBUTE BY HASH (sr_ticket_number,sr_item_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (sr_ticket_number,sr_item_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -319,7 +319,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.web_returns ( wr_net_loss DOUBLE, PRIMARY KEY (wr_order_number, wr_item_sk) ) -DISTRIBUTE BY HASH (wr_order_number,wr_item_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (wr_order_number,wr_item_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -382,7 +382,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.catalog_returns ( cr_net_loss DOUBLE, PRIMARY KEY (cr_order_number, cr_item_sk) ) -DISTRIBUTE BY HASH (cr_order_number,cr_item_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (cr_order_number,cr_item_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -425,7 +425,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.inventory ( inv_quantity_on_hand BIGINT, PRIMARY KEY (inv_date_sk, inv_item_sk, inv_warehouse_sk) ) -DISTRIBUTE BY HASH (inv_item_sk,inv_date_sk,inv_warehouse_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (inv_item_sk,inv_date_sk,inv_warehouse_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -453,7 +453,7 @@ CREATE TABLE {target_db_name}.customer ( c_email_address STRING, c_last_review_date BIGINT ) -DISTRIBUTE BY HASH (c_customer_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (c_customer_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -475,7 +475,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.customer_address ( ca_gmt_offset DOUBLE, ca_location_type STRING ) -DISTRIBUTE BY HASH (ca_address_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (ca_address_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -494,7 +494,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.customer_demographics ( cd_dep_employed_count BIGINT, cd_dep_college_count BIGINT ) -DISTRIBUTE BY HASH (cd_demo_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (cd_demo_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -532,7 +532,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.date_dim ( d_current_quarter STRING, d_current_year STRING ) -DISTRIBUTE BY HASH (d_date_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (d_date_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -546,7 +546,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.household_demographics ( hd_dep_count BIGINT, hd_vehicle_count BIGINT ) -DISTRIBUTE BY HASH (hd_demo_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (hd_demo_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -578,7 +578,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.item ( i_manager_id BIGINT, i_product_name STRING ) -DISTRIBUTE BY HASH (i_item_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (i_item_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -606,7 +606,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.promotion ( p_purpose STRING, p_discount_active STRING ) -DISTRIBUTE BY HASH (p_promo_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (p_promo_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -665,7 +665,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.store ( s_gmt_offset DOUBLE, s_tax_precentage DOUBLE ) -DISTRIBUTE BY HASH (s_store_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (s_store_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -684,7 +684,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.time_dim ( t_sub_shift STRING, t_meal_time STRING ) -DISTRIBUTE BY HASH (t_time_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (t_time_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -724,7 +724,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.call_center ( cc_gmt_offset DOUBLE, cc_tax_percentage DOUBLE ) -DISTRIBUTE BY HASH (cc_call_center_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (cc_call_center_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -742,7 +742,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.catalog_page ( cp_description STRING, cp_type STRING ) -DISTRIBUTE BY HASH (cp_catalog_page_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (cp_catalog_page_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -754,7 +754,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.income_band ( ib_lower_bound BIGINT, ib_upper_bound BIGINT ) -DISTRIBUTE BY HASH (ib_income_band_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (ib_income_band_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -766,7 +766,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.reason ( r_reason_id STRING, r_reason_desc STRING ) -DISTRIBUTE BY HASH (r_reason_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (r_reason_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -781,7 +781,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.ship_mode ( sm_carrier STRING, sm_contract STRING ) -DISTRIBUTE BY HASH (sm_ship_mode_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (sm_ship_mode_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -804,7 +804,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.warehouse ( w_country STRING, w_gmt_offset DOUBLE ) -DISTRIBUTE BY HASH (w_warehouse_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (w_warehouse_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -827,7 +827,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.web_page ( wp_image_count BIGINT, wp_max_ad_count BIGINT ) -DISTRIBUTE BY HASH (wp_web_page_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (wp_web_page_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); @@ -862,7 +862,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.web_site ( web_gmt_offset DOUBLE, web_tax_percentage DOUBLE ) -DISTRIBUTE BY HASH (web_site_sk) INTO {buckets} BUCKETS +PARTITION BY HASH (web_site_sk) INTO {buckets} BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_master}:7051'); http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/datasets/tpch/tpch_kudu_template.sql ---------------------------------------------------------------------- diff --git a/testdata/datasets/tpch/tpch_kudu_template.sql b/testdata/datasets/tpch/tpch_kudu_template.sql index 26dbb7a..ed9765d 100644 --- a/testdata/datasets/tpch/tpch_kudu_template.sql +++ b/testdata/datasets/tpch/tpch_kudu_template.sql @@ -42,7 +42,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.lineitem ( L_COMMENT STRING, PRIMARY KEY (L_ORDERKEY, L_LINENUMBER) ) -distribute by hash (l_orderkey) into {buckets} buckets +partition by hash (l_orderkey) into {buckets} buckets STORED AS KUDU tblproperties ('kudu.master_addresses' = '{kudu_master}:7051'); @@ -78,7 +78,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.part ( P_RETAILPRICE DOUBLE, P_COMMENT STRING ) -distribute by hash (p_partkey) into {buckets} buckets +partition by hash (p_partkey) into {buckets} buckets STORED AS KUDU tblproperties ('kudu.master_addresses' = '{kudu_master}:7051'); @@ -93,7 +93,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.partsupp ( PS_COMMENT STRING, PRIMARY KEY (PS_PARTKEY, PS_SUPPKEY) ) -distribute by hash (ps_partkey, ps_suppkey) into {buckets} buckets +partition by hash (ps_partkey, ps_suppkey) into {buckets} buckets STORED AS KUDU tblproperties ('kudu.master_addresses' = '{kudu_master}:7051'); @@ -109,7 +109,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.supplier ( S_ACCTBAL DOUBLE, S_COMMENT STRING ) -distribute by hash (s_suppkey) into {buckets} buckets +partition by hash (s_suppkey) into {buckets} buckets STORED AS KUDU tblproperties ('kudu.master_addresses' = '{kudu_master}:7051'); @@ -122,7 +122,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.nation ( N_REGIONKEY BIGINT, N_COMMENT STRING ) -distribute by hash (n_nationkey) into {buckets} buckets +partition by hash (n_nationkey) into {buckets} buckets STORED AS KUDU tblproperties ('kudu.master_addresses' = '{kudu_master}:7051'); @@ -134,7 +134,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.region ( R_NAME STRING, R_COMMENT STRING ) -distribute by hash (r_regionkey) into {buckets} buckets +partition by hash (r_regionkey) into {buckets} buckets STORED AS KUDU tblproperties ('kudu.master_addresses' = '{kudu_master}:7051'); @@ -152,7 +152,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.orders ( O_SHIPPRIORITY BIGINT, O_COMMENT STRING ) -distribute by hash (o_orderkey) into {buckets} buckets +partition by hash (o_orderkey) into {buckets} buckets STORED AS KUDU tblproperties ('kudu.master_addresses' = '{kudu_master}:7051'); @@ -169,7 +169,7 @@ CREATE TABLE IF NOT EXISTS {target_db_name}.customer ( C_MKTSEGMENT STRING, C_COMMENT STRING ) -distribute by hash (c_custkey) into {buckets} buckets +partition by hash (c_custkey) into {buckets} buckets STORED AS KUDU tblproperties ('kudu.master_addresses' = '{kudu_master}:7051'); http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/datasets/tpch/tpch_schema_template.sql ---------------------------------------------------------------------- diff --git a/testdata/datasets/tpch/tpch_schema_template.sql b/testdata/datasets/tpch/tpch_schema_template.sql index 0512f6a..dfa2305 100644 --- a/testdata/datasets/tpch/tpch_schema_template.sql +++ b/testdata/datasets/tpch/tpch_schema_template.sql @@ -60,7 +60,7 @@ create table if not exists {db_name}{db_suffix}.{table_name} ( L_COMMENT STRING, PRIMARY KEY(L_ORDERKEY, L_PARTKEY, L_SUPPKEY, L_LINENUMBER) ) -distribute by hash (l_orderkey) into 9 buckets stored as kudu; +partition by hash (l_orderkey) into 9 buckets stored as kudu; ---- DEPENDENT_LOAD INSERT OVERWRITE TABLE {db_name}{db_suffix}.{table_name} SELECT * FROM {db_name}.{table_name}; ---- LOAD @@ -95,7 +95,7 @@ create table if not exists {db_name}{db_suffix}.{table_name} ( P_RETAILPRICE DOUBLE, P_COMMENT STRING ) -distribute by hash (p_partkey) into 9 buckets stored as kudu; +partition by hash (p_partkey) into 9 buckets stored as kudu; ---- DEPENDENT_LOAD INSERT OVERWRITE TABLE {db_name}{db_suffix}.{table_name} SELECT * FROM {db_name}.{table_name}; ---- LOAD @@ -123,7 +123,7 @@ create table if not exists {db_name}{db_suffix}.{table_name} ( PS_COMMENT STRING, PRIMARY KEY(PS_PARTKEY, PS_SUPPKEY) ) -distribute by hash (ps_partkey, ps_suppkey) into 9 buckets stored as kudu; +partition by hash (ps_partkey, ps_suppkey) into 9 buckets stored as kudu; ---- DEPENDENT_LOAD INSERT OVERWRITE TABLE {db_name}{db_suffix}.{table_name} SELECT * FROM {db_name}.{table_name}; ---- LOAD @@ -154,7 +154,7 @@ create table if not exists {db_name}{db_suffix}.{table_name} ( S_ACCTBAL DOUBLE, S_COMMENT STRING ) -distribute by hash (s_suppkey) into 9 buckets stored as kudu; +partition by hash (s_suppkey) into 9 buckets stored as kudu; ---- DEPENDENT_LOAD INSERT OVERWRITE TABLE {db_name}{db_suffix}.{table_name} SELECT * FROM {db_name}.{table_name}; ---- LOAD @@ -179,7 +179,7 @@ create table if not exists {db_name}{db_suffix}.{table_name} ( N_REGIONKEY SMALLINT, N_COMMENT STRING ) -distribute by hash (n_nationkey) into 9 buckets stored as kudu; +partition by hash (n_nationkey) into 9 buckets stored as kudu; ---- DEPENDENT_LOAD INSERT OVERWRITE TABLE {db_name}{db_suffix}.{table_name} SELECT * FROM {db_name}.{table_name}; ---- LOAD @@ -202,7 +202,7 @@ create table if not exists {db_name}{db_suffix}.{table_name} ( R_NAME STRING, R_COMMENT STRING ) -distribute by hash (r_regionkey) into 9 buckets stored as kudu; +partition by hash (r_regionkey) into 9 buckets stored as kudu; ---- DEPENDENT_LOAD INSERT OVERWRITE TABLE {db_name}{db_suffix}.{table_name} SELECT * FROM {db_name}.{table_name}; ---- LOAD @@ -237,7 +237,7 @@ create table if not exists {db_name}{db_suffix}.{table_name} ( O_SHIPPRIORITY INT, O_COMMENT STRING ) -distribute by hash (o_orderkey) into 9 buckets stored as kudu; +partition by hash (o_orderkey) into 9 buckets stored as kudu; ---- DEPENDENT_LOAD INSERT OVERWRITE TABLE {db_name}{db_suffix}.{table_name} SELECT * FROM {db_name}.{table_name}; ---- LOAD @@ -270,7 +270,7 @@ create table if not exists {db_name}{db_suffix}.{table_name} ( C_MKTSEGMENT STRING, C_COMMENT STRING ) -distribute by hash (c_custkey) into 9 buckets stored as kudu; +partition by hash (c_custkey) into 9 buckets stored as kudu; ---- DEPENDENT_LOAD INSERT OVERWRITE TABLE {db_name}{db_suffix}.{table_name} SELECT * FROM {db_name}.{table_name}; ---- LOAD http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/workloads/functional-planner/queries/PlannerTest/lineage.test ---------------------------------------------------------------------- diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/lineage.test b/testdata/workloads/functional-planner/queries/PlannerTest/lineage.test index c2d916e..5dfa96a 100644 --- a/testdata/workloads/functional-planner/queries/PlannerTest/lineage.test +++ b/testdata/workloads/functional-planner/queries/PlannerTest/lineage.test @@ -4717,13 +4717,13 @@ functional.alltypes where id < 10 } ==== # CTAS a Kudu table -create table kudu_ctas primary key (id) distribute by hash (id) into 3 buckets +create table kudu_ctas primary key (id) partition by hash (id) into 3 buckets stored as kudu as select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col from functional.alltypestiny ---- LINEAGE { - "queryText":"create table kudu_ctas primary key (id) distribute by hash (id) into 3 buckets\nstored as kudu as select id, bool_col, tinyint_col, smallint_col, int_col,\nbigint_col, float_col, double_col, date_string_col, string_col\nfrom functional.alltypestiny", + "queryText":"create table kudu_ctas primary key (id) partition by hash (id) into 3 buckets\nstored as kudu as select id, bool_col, tinyint_col, smallint_col, int_col,\nbigint_col, float_col, double_col, date_string_col, string_col\nfrom functional.alltypestiny", "hash":"6e3e192c7fb8bb6b22674a9b7b488b55", "user":"dev", "timestamp":1479933751, http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/workloads/functional-query/queries/QueryTest/kudu-scan-node.test ---------------------------------------------------------------------- diff --git a/testdata/workloads/functional-query/queries/QueryTest/kudu-scan-node.test b/testdata/workloads/functional-query/queries/QueryTest/kudu-scan-node.test index 1017658..21b1b95 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/kudu-scan-node.test +++ b/testdata/workloads/functional-query/queries/QueryTest/kudu-scan-node.test @@ -21,7 +21,7 @@ INT, BIGINT # Regression test for IMPALA-2740, a NULL value from a previously filtered row would # carry over into the next unfiltered row (the result below would incorrectly be 2,NULL). CREATE TABLE impala_2740 (key INT PRIMARY KEY, value INT) - DISTRIBUTE BY HASH (key) INTO 3 BUCKETS STORED AS KUDU; + PARTITION BY HASH (key) INTO 3 BUCKETS STORED AS KUDU; INSERT INTO impala_2740 VALUES (1, NULL), (2, -2); SELECT * FROM impala_2740 WHERE key != 1; ---- RESULTS @@ -35,9 +35,9 @@ INT, INT # is run on all impalads. However, for the t1 table there is only as single scan range, # so two of the scan instances get empty scan ranges. CREATE TABLE impala_2635_t1 (id BIGINT PRIMARY KEY, name STRING) - DISTRIBUTE BY HASH (id) INTO 3 BUCKETS STORED AS KUDU; + PARTITION BY HASH (id) INTO 3 BUCKETS STORED AS KUDU; CREATE TABLE impala_2635_t2 (id BIGINT PRIMARY KEY, name STRING) - DISTRIBUTE BY HASH(id) INTO 16 BUCKETS STORED AS KUDU; + PARTITION BY HASH(id) INTO 16 BUCKETS STORED AS KUDU; INSERT INTO impala_2635_t1 VALUES (0, 'Foo'); INSERT INTO impala_2635_t2 VALUES (1, 'Blah'); SELECT * FROM impala_2635_t1 UNION ALL SELECT * FROM impala_2635_t2; http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/workloads/functional-query/queries/QueryTest/kudu-timeouts-catalogd.test ---------------------------------------------------------------------- diff --git a/testdata/workloads/functional-query/queries/QueryTest/kudu-timeouts-catalogd.test b/testdata/workloads/functional-query/queries/QueryTest/kudu-timeouts-catalogd.test index 253c139..ac57812 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/kudu-timeouts-catalogd.test +++ b/testdata/workloads/functional-query/queries/QueryTest/kudu-timeouts-catalogd.test @@ -12,7 +12,7 @@ Error opening Kudu table 'impala::functional_kudu.alltypes' ==== ---- QUERY create table test_kudu (x int primary key) -distribute by hash(x) into 3 buckets stored as kudu +partition by hash(x) into 3 buckets stored as kudu ---- CATCH Error creating Kudu table ==== http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/workloads/functional-query/queries/QueryTest/kudu_alter.test ---------------------------------------------------------------------- diff --git a/testdata/workloads/functional-query/queries/QueryTest/kudu_alter.test b/testdata/workloads/functional-query/queries/QueryTest/kudu_alter.test index 116a7e9..8722f8a 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/kudu_alter.test +++ b/testdata/workloads/functional-query/queries/QueryTest/kudu_alter.test @@ -1,7 +1,7 @@ ==== ---- QUERY create table simple (id int primary key, name string, valf float, vali bigint) - distribute by hash (id) into 3 buckets stored as kudu + partition by hash (id) into 3 buckets stored as kudu ---- RESULTS ==== ---- QUERY @@ -49,7 +49,7 @@ BIGINT ---- QUERY # Create a table with range distribution create table tbl_to_alter (id int primary key, name string null, vali bigint not null) - distribute by range (id) (partition 1 < values <= 10) stored as kudu + partition by range (id) (partition 1 < values <= 10) stored as kudu ---- RESULTS ==== ---- QUERY @@ -294,7 +294,7 @@ alter table tbl_to_alter set tblproperties('kudu.table_name'='kudu_tbl_to_alter' ==== ---- QUERY # Create a new table and try to rename to an existing kudu table -create table copy_of_tbl (a int primary key) distribute by hash (a) into 3 buckets +create table copy_of_tbl (a int primary key) partition by hash (a) into 3 buckets stored as kudu tblproperties('kudu.table_name'='copy_of_tbl'); alter table copy_of_tbl set tblproperties('kudu.table_name'='kudu_tbl_to_alter') ---- CATCH http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/workloads/functional-query/queries/QueryTest/kudu_create.test ---------------------------------------------------------------------- diff --git a/testdata/workloads/functional-query/queries/QueryTest/kudu_create.test b/testdata/workloads/functional-query/queries/QueryTest/kudu_create.test index d04efd6..651979d 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/kudu_create.test +++ b/testdata/workloads/functional-query/queries/QueryTest/kudu_create.test @@ -1,6 +1,6 @@ ==== ---- QUERY -create table t primary key (id) distribute by hash (id) into 3 buckets +create table t primary key (id) partition by hash (id) into 3 buckets stored as kudu as select id, int_col from functional.alltypestiny; select * from t; @@ -19,14 +19,14 @@ INT,INT ---- QUERY # Boolean primary key column create table tab (x int, y boolean, primary key(x, y)) - distribute by hash (x) into 3 buckets stored as kudu + partition by hash (x) into 3 buckets stored as kudu ---- CATCH NonRecoverableException: Key column may not have type of BOOL, FLOAT, or DOUBLE ==== ---- QUERY # Float primary key column create table tab (x int, y float, primary key(x, y)) - distribute by hash (x) into 3 buckets stored as kudu + partition by hash (x) into 3 buckets stored as kudu ---- CATCH NonRecoverableException: Key column may not have type of BOOL, FLOAT, or DOUBLE ==== @@ -34,27 +34,27 @@ NonRecoverableException: Key column may not have type of BOOL, FLOAT, or DOUBLE # Primary keys should be declared first # TODO: See KUDU-1709 for improving Kudu error messages. create table tab (x int, y int, primary key(y)) - distribute by hash (y) into 3 buckets stored as kudu + partition by hash (y) into 3 buckets stored as kudu ---- CATCH NonRecoverableException: Got out-of-order key column: name: "y" type: INT32 is_key: true is_nullable: false cfile_block_size: 0 ==== ---- QUERY # Small number of hash buckets create table tab (a int, b int, c int, d int, primary key(a, b, c)) - distribute by hash(a,b) into 8 buckets, hash(c) into 1 buckets stored as kudu + partition by hash(a,b) into 8 buckets, hash(c) into 1 buckets stored as kudu ---- CATCH NonRecoverableException: must have at least two hash buckets ==== ---- QUERY # Same column in multiple hash based distributions create table tab (a int, b int, primary key (a)) - distribute by hash (a) into 3 buckets, hash (a) into 2 buckets stored as kudu + partition by hash (a) into 3 buckets, hash (a) into 2 buckets stored as kudu ---- CATCH NonRecoverableException: hash bucket schema components must not contain columns in common ==== ---- QUERY # Same column referenced multiple times in the same hash-based distribution -create table tab (a int primary key) distribute by hash (a, a, a) into 3 buckets +create table tab (a int primary key) partition by hash (a, a, a) into 3 buckets stored as kudu ---- CATCH NonRecoverableException: hash bucket schema components must not contain columns in common @@ -62,7 +62,7 @@ NonRecoverableException: hash bucket schema components must not contain columns ---- QUERY # Kudu table that uses Impala keywords as table name and column names create table `add`(`analytic` int, `function` int, primary key(`analytic`, `function`)) -distribute by hash (`analytic`) into 4 buckets, range (`function`) +partition by hash (`analytic`) into 4 buckets, range (`function`) (partition values <= 1, partition 1 < values <= 10, partition 10 < values) stored as kudu; insert into `add` select id, int_col from functional.alltypestiny; select * from `add` @@ -80,14 +80,14 @@ INT,INT ==== ---- QUERY # Test implicit casting/folding of partition values. -create table tab (a int primary key) distribute by range (a) (partition value = false) +create table tab (a int primary key) partition by range (a) (partition value = false) stored as kudu ---- RESULTS ==== ---- QUERY # Invalid hostname create table tdata_bogus_host (id int primary key, name string, valf float, vali bigint) - DISTRIBUTE BY RANGE (PARTITION 10 <= VALUES <= 30) STORED AS KUDU + PARTITION BY RANGE (PARTITION 10 <= VALUES <= 30) STORED AS KUDU TBLPROPERTIES('kudu.master_addresses' = 'bogus host name') ---- CATCH Couldn't resolve this master's address bogus host name:7051 @@ -96,7 +96,7 @@ Couldn't resolve this master's address bogus host name:7051 # Non-existing host create table tdata_non_existing_host (id int primary key, name string, valf float, vali bigint) - DISTRIBUTE BY RANGE (PARTITION 10 <= VALUES <= 30) STORED AS KUDU + PARTITION BY RANGE (PARTITION 10 <= VALUES <= 30) STORED AS KUDU TBLPROPERTIES('kudu.master_addresses' = 'bogus.host.name') ---- CATCH Couldn't resolve this master's address bogus.host.name:7051 @@ -104,7 +104,7 @@ Couldn't resolve this master's address bogus.host.name:7051 ---- QUERY # Test that string case is ignored create table ignore_column_case (Id int, NAME string, vAlf float, vali bigint, - primary key (Id, NAME)) DISTRIBUTE BY RANGE (PARTITION VALUE = (1, 'Martin')) + primary key (Id, NAME)) PARTITION BY RANGE (PARTITION VALUE = (1, 'Martin')) STORED AS KUDU ---- RESULTS ==== http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/workloads/functional-query/queries/QueryTest/kudu_delete.test ---------------------------------------------------------------------- diff --git a/testdata/workloads/functional-query/queries/QueryTest/kudu_delete.test b/testdata/workloads/functional-query/queries/QueryTest/kudu_delete.test index 9e2a924..4dd3377 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/kudu_delete.test +++ b/testdata/workloads/functional-query/queries/QueryTest/kudu_delete.test @@ -3,7 +3,7 @@ create table tdata (id int primary key, valf float null, vali bigint null, valv string null, valb boolean null, valt tinyint null, vals smallint null, vald double null) - DISTRIBUTE BY RANGE (PARTITION VALUES < 100, PARTITION 100 <= VALUES < 1000, + PARTITION BY RANGE (PARTITION VALUES < 100, PARTITION 100 <= VALUES < 1000, PARTITION 1000 <= VALUES <= 10000) STORED AS KUDU ---- RESULTS ==== @@ -301,7 +301,7 @@ create table multiple_key_cols smallint_col smallint, bool_col boolean null, int_col int null, double_col double null, float_col float null, primary key (string_col, bigint_col, tinyint_col, smallint_col)) - DISTRIBUTE BY HASH (string_col) INTO 16 BUCKETS STORED AS KUDU + PARTITION BY HASH (string_col) INTO 16 BUCKETS STORED AS KUDU ==== ---- QUERY insert into multiple_key_cols values @@ -343,7 +343,7 @@ STRING,BIGINT,TINYINT,SMALLINT,BOOLEAN,INT,DOUBLE,FLOAT # IMPALA-3454: A delete that requires a rewrite may not get the Kudu column order correct # if the Kudu columns are of different types. create table impala_3454 (key_1 tinyint, key_2 bigint, PRIMARY KEY (key_1, key_2)) - DISTRIBUTE BY HASH INTO 3 BUCKETS STORED AS KUDU + PARTITION BY HASH INTO 3 BUCKETS STORED AS KUDU ---- RESULTS ==== ---- QUERY http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/workloads/functional-query/queries/QueryTest/kudu_describe.test ---------------------------------------------------------------------- diff --git a/testdata/workloads/functional-query/queries/QueryTest/kudu_describe.test b/testdata/workloads/functional-query/queries/QueryTest/kudu_describe.test index 3d8ac2c..fade3ce 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/kudu_describe.test +++ b/testdata/workloads/functional-query/queries/QueryTest/kudu_describe.test @@ -30,7 +30,7 @@ create table describe_test c2 int not null default 100 encoding plain_encoding compression snappy, c3 int null block_size 8388608, primary key (pk1, pk2, pk3)) -distribute by hash (pk1) into 3 buckets +partition by hash (pk1) into 3 buckets stored as kudu; describe describe_test; ---- LABELS http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/workloads/functional-query/queries/QueryTest/kudu_insert.test ---------------------------------------------------------------------- diff --git a/testdata/workloads/functional-query/queries/QueryTest/kudu_insert.test b/testdata/workloads/functional-query/queries/QueryTest/kudu_insert.test index e282567..d67b75f 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/kudu_insert.test +++ b/testdata/workloads/functional-query/queries/QueryTest/kudu_insert.test @@ -3,7 +3,7 @@ create table tdata (id int primary key, valf float null, vali bigint null, valv string null, valb boolean null, valt tinyint null, vals smallint null, vald double null) - DISTRIBUTE BY RANGE (PARTITION VALUES < 10, PARTITION 10 <= VALUES < 30, + PARTITION BY RANGE (PARTITION VALUES < 10, PARTITION 10 <= VALUES < 30, PARTITION 30 <= VALUES) STORED AS KUDU ---- RESULTS ==== @@ -238,7 +238,7 @@ NumRowErrors: 1 ==== ---- QUERY create table kudu_test_tbl primary key(id) -distribute by range(id) (partition values < 100, partition 100 <= values <= 10000) +partition by range(id) (partition values < 100, partition 100 <= values <= 10000) stored as kudu as select * from functional_kudu.alltypes where id < 100; ---- RESULTS @@ -281,7 +281,7 @@ NumRowErrors: 7299 # IMPALA-2521: clustered insert into table. create table impala_2521 (id bigint primary key, name string, zip int) -distribute by hash into 3 buckets stored as kudu +partition by hash into 3 buckets stored as kudu ---- RESULTS ==== ---- QUERY @@ -316,7 +316,7 @@ BIGINT,STRING,INT ---- QUERY # Table with all supported types as primary key and distribution columns create table allkeytypes (i1 tinyint, i2 smallint, i3 int, i4 bigint, name string, - valf float, vald double, primary key (i1, i2, i3, i4, name)) distribute by + valf float, vald double, primary key (i1, i2, i3, i4, name)) partition by hash into 3 buckets, range (partition value = (1,1,1,1,'1'), partition value = (2,2,2,2,'2'), partition value = (3,3,3,3,'3')) stored as kudu ---- RESULTS @@ -335,7 +335,7 @@ NumRowErrors: 6 # Table with default values create table tbl_with_defaults (a int primary key, b int null default 10, c int not null default 100, d int default 1000, e int null, f int not null, - g string default 'test', h boolean default true) distribute by hash (a) into 3 + g string default 'test', h boolean default true) partition by hash (a) into 3 buckets stored as kudu ---- RESULTS ==== http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/workloads/functional-query/queries/QueryTest/kudu_partition_ddl.test ---------------------------------------------------------------------- diff --git a/testdata/workloads/functional-query/queries/QueryTest/kudu_partition_ddl.test b/testdata/workloads/functional-query/queries/QueryTest/kudu_partition_ddl.test index 13eec9d..5e9c477 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/kudu_partition_ddl.test +++ b/testdata/workloads/functional-query/queries/QueryTest/kudu_partition_ddl.test @@ -2,7 +2,7 @@ ---- QUERY -- Test hash partitioning create table simple_hash (id int, name string, valf float, vali bigint, - primary key (id, name)) distribute by hash(id) INTO 4 buckets, + primary key (id, name)) partition by hash(id) INTO 4 buckets, hash(name) INTO 2 buckets stored as kudu ---- RESULTS ==== @@ -25,7 +25,7 @@ INT,STRING,STRING,STRING,INT ---- QUERY -- Test single column range partitioning with bounded and unbounded partitions create table range_part_bounds (id int, name string, valf float, vali bigint, - primary key (id, name)) distribute by range (id) + primary key (id, name)) partition by range (id) (partition values <= 10, partition 10 < values <= 20, partition 20 < values) stored as kudu ---- RESULTS @@ -44,7 +44,7 @@ INT,STRING,STRING,STRING,INT ---- QUERY -- Test single column range partitioning with single value partitions create table range_part_single (id int, name string, valf float, vali bigint, - primary key (id, name)) distribute by range (id) + primary key (id, name)) partition by range (id) (partition value = 1, partition value = 10, partition value = 100) stored as kudu ---- RESULTS @@ -64,7 +64,7 @@ INT,STRING,STRING,STRING,INT -- Test single column range partitioning with bounded, unbounded and single -- value partitions create table range_part_multiple_bounds (id int, name string, valf float, - primary key (id, name)) distribute by range (id) + primary key (id, name)) partition by range (id) (partition values <= 10, partition 10 < values <= 20, partition 20 < values <= 30, partition value = 40, partition value = 50) stored as kudu ---- RESULTS @@ -85,7 +85,7 @@ INT,STRING,STRING,STRING,INT ---- QUERY -- Test multiple column range partitioning create table range_part_multiple_cols (id int, name string, valf float, vali bigint, - primary key (id, name)) distribute by range (id, name) + primary key (id, name)) partition by range (id, name) (partition value = (10, 'martin'), partition value = (20, 'dimitris'), partition value = (30, 'matthew')) stored as kudu ---- RESULTS @@ -104,7 +104,7 @@ INT,STRING,STRING,STRING,INT ---- QUERY -- Test single column range partitioning with string partition column create table range_part_single_string_col (id int, name string, valf float, - primary key (id, name)) distribute by range(name) + primary key (id, name)) partition by range(name) (partition values <= 'aaa', partition 'aaa' < values <= 'bbb', partition 'bbb' < values <= 'ccc', partition value = 'ddd') stored as kudu ---- RESULTS @@ -124,7 +124,7 @@ INT,STRING,STRING,STRING,INT ---- QUERY -- Test hash and range partitioning create table simple_hash_range (id int, name string, valf float, vali bigint, - primary key (id, name)) distribute by hash(id) into 4 buckets, range(id, name) + primary key (id, name)) partition by hash(id) into 4 buckets, range(id, name) (partition value = (10, 'martin'), partition value = (20, 'alex')) stored as kudu ---- RESULTS ==== @@ -146,7 +146,7 @@ INT,STRING,STRING,STRING,INT ==== ---- QUERY create table simple_hash_range_ctas - primary key (id, name) distribute by hash(id) into 4 buckets, + primary key (id, name) partition by hash(id) into 4 buckets, range(id, name) (partition value = (10, 'casey'), partition value = (20, 'marcel')) stored as kudu as select * from simple_hash @@ -172,7 +172,7 @@ INT,STRING,STRING,STRING,INT ---- QUERY -- Test hash defaults to all columns create table simple_hash_all_columns (id int, name string, valf float, vali bigint, - primary key (id, name)) distribute by hash into 4 buckets stored as kudu + primary key (id, name)) partition by hash into 4 buckets stored as kudu ---- RESULTS ==== ---- QUERY @@ -190,7 +190,7 @@ INT,STRING,STRING,STRING,INT ---- QUERY -- Test range defaults to all columns create table simple_range_all_columns (id int, name string, valf float, vali bigint, - primary key (id, name)) distribute by range + primary key (id, name)) partition by range (partition value = (1, 'a'), partition value = (2, 'b')) stored as kudu ---- RESULTS @@ -208,7 +208,7 @@ INT,STRING,STRING,STRING,INT ---- QUERY -- Test using non-literal constant values in range-partition bounds create table range_complex_const_boundary_vals (x int, y int, primary key (x)) - distribute by range (x) (partition values < 1 + 1, partition (1+3) + 2 < values < 10, + partition by range (x) (partition values < 1 + 1, partition (1+3) + 2 < values < 10, partition factorial(4) < values < factorial(5), partition value = factorial(6)) stored as kudu ---- RESULTS @@ -228,7 +228,7 @@ INT,STRING,STRING,STRING,INT ---- QUERY -- Test range partitioning with overlapping partitions create table simple_range_with_overlapping (id int, name string, valf float, vali bigint, - primary key (id, name)) distribute by range (id) + primary key (id, name)) partition by range (id) (partition values <= 10, partition values < 20, partition value = 5) stored as kudu ---- CATCH NonRecoverableException: overlapping range partitions: first range partition: [, (int32 id=11)), second range partition: [, (int32 id=20)) @@ -236,7 +236,7 @@ NonRecoverableException: overlapping range partitions: first range partition: [< ---- QUERY -- Test range partitioning with the same partition specified multiple times create table simple_range_duplicate_parts (id int, name string, valf float, vali bigint, - primary key(id, name)) distribute by range (id) + primary key(id, name)) partition by range (id) (partition 10 < values <= 20, partition 10 < values <= 20) stored as kudu ---- CATCH NonRecoverableException: overlapping range partitions: first range partition: [(int32 id=11), (int32 id=21)), second range partition: [(int32 id=11), (int32 id=21)) @@ -244,7 +244,7 @@ NonRecoverableException: overlapping range partitions: first range partition: [( ---- QUERY -- Test multi-column range partitioning with the same partition specified multiple times create table range_multi_col_duplicate_parts (id int, name string, valf float, - vali bigint, primary key (id, name)) distribute by range (id, name) + vali bigint, primary key (id, name)) partition by range (id, name) (partition value = (10, 'dimitris'), partition value = (10, 'dimitris')) stored as kudu ---- CATCH NonRecoverableException: overlapping range partitions: first range partition: [(int32 id=10, string name=dimitris), (int32 id=10, string name=dimitris\000)), second range partition: [(int32 id=10, string name=dimitris), (int32 id=10, string name=dimitris\000)) http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/workloads/functional-query/queries/QueryTest/kudu_stats.test ---------------------------------------------------------------------- diff --git a/testdata/workloads/functional-query/queries/QueryTest/kudu_stats.test b/testdata/workloads/functional-query/queries/QueryTest/kudu_stats.test index dc8f052..d3b7bd3 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/kudu_stats.test +++ b/testdata/workloads/functional-query/queries/QueryTest/kudu_stats.test @@ -1,7 +1,7 @@ ==== ---- QUERY create table simple (id int primary key, name string, valf float, vali bigint) - distribute by range (partition values < 10, partition 10 <= values < 30, + partition by range (partition values < 10, partition 10 <= values < 30, partition 30 <= values) stored as kudu tblproperties('kudu.num_tablet_replicas' = '2') ---- RESULTS ==== http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/workloads/functional-query/queries/QueryTest/kudu_update.test ---------------------------------------------------------------------- diff --git a/testdata/workloads/functional-query/queries/QueryTest/kudu_update.test b/testdata/workloads/functional-query/queries/QueryTest/kudu_update.test index 27120f5..8d0d149 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/kudu_update.test +++ b/testdata/workloads/functional-query/queries/QueryTest/kudu_update.test @@ -4,7 +4,7 @@ create table tdata (id int primary key, name string null, valf float null, vali bigint null, valv string null, valb boolean null, valt tinyint null, vals smallint null, vald double null) - DISTRIBUTE BY RANGE (PARTITION VALUES < 10, PARTITION 10 <= VALUES < 30, + PARTITION BY RANGE (PARTITION VALUES < 10, PARTITION 10 <= VALUES < 30, PARTITION 30 <= VALUES <= 10000) STORED AS KUDU ---- RESULTS ==== http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/testdata/workloads/functional-query/queries/QueryTest/kudu_upsert.test ---------------------------------------------------------------------- diff --git a/testdata/workloads/functional-query/queries/QueryTest/kudu_upsert.test b/testdata/workloads/functional-query/queries/QueryTest/kudu_upsert.test index 0f117f1..b0adb48 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/kudu_upsert.test +++ b/testdata/workloads/functional-query/queries/QueryTest/kudu_upsert.test @@ -4,7 +4,7 @@ create table tdata (id int primary key, name string null, valf float null, vali bigint null, valv string null, valb boolean null, valt tinyint null, vals smallint null, vald double null) - DISTRIBUTE BY RANGE (PARTITION VALUES < 10, PARTITION 10 <= VALUES < 30, + PARTITION BY RANGE (PARTITION VALUES < 10, PARTITION 10 <= VALUES < 30, PARTITION 30 <= VALUES) STORED AS KUDU ---- RESULTS ==== @@ -392,7 +392,7 @@ create table multiple_key_cols (string_col string, bigint_col bigint, tinyint_col tinyint, smallint_col smallint, bool_col boolean null, int_col int null, double_col double null, float_col float null, primary key (string_col, bigint_col, tinyint_col, smallint_col)) - DISTRIBUTE BY HASH (string_col) INTO 16 BUCKETS STORED AS KUDU + PARTITION BY HASH (string_col) INTO 16 BUCKETS STORED AS KUDU ==== ---- QUERY insert into multiple_key_cols values http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/tests/query_test/test_cancellation.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_cancellation.py b/tests/query_test/test_cancellation.py index 91e81dc..b660c61 100644 --- a/tests/query_test/test_cancellation.py +++ b/tests/query_test/test_cancellation.py @@ -102,7 +102,7 @@ class TestCancellation(ImpalaTestSuite): assert QUERIES.has_key(query) and QUERIES[query] is not None,\ "PRIMARY KEY for query %s not specified" % query query = "create table ctas_cancel primary key (%s) "\ - "distribute by hash into 3 buckets stored as kudu as %s" %\ + "partition by hash into 3 buckets stored as kudu as %s" %\ (QUERIES[query], query) else: query = "create table ctas_cancel stored as %sfile as %s" %\ http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/tests/query_test/test_kudu.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_kudu.py b/tests/query_test/test_kudu.py index 9c9112e..602b5f4 100644 --- a/tests/query_test/test_kudu.py +++ b/tests/query_test/test_kudu.py @@ -83,7 +83,7 @@ class TestKuduOperations(KuduTestSuite): for nullable in nullability: impala_tbl_name = "test_column_options_%s" % str(indx) cursor.execute("""CREATE TABLE %s.%s (a INT PRIMARY KEY - %s %s %s %s, b INT %s %s %s %s %s) DISTRIBUTE BY HASH (a) INTO 3 + %s %s %s %s, b INT %s %s %s %s %s) PARTITION BY HASH (a) INTO 3 BUCKETS STORED AS KUDU""" % (unique_database, impala_tbl_name, encoding, compression, default, blocksize, nullable, encoding, compression, default, blocksize)) @@ -93,7 +93,7 @@ class TestKuduOperations(KuduTestSuite): def test_kudu_rename_table(self, cursor, kudu_client, unique_database): """Test Kudu table rename""" - cursor.execute("""CREATE TABLE %s.foo (a INT PRIMARY KEY) DISTRIBUTE BY HASH(a) + cursor.execute("""CREATE TABLE %s.foo (a INT PRIMARY KEY) PARTITION BY HASH(a) INTO 3 BUCKETS STORED AS KUDU""" % unique_database) kudu_tbl_name = "impala::%s.foo" % unique_database assert kudu_client.table_exists(kudu_tbl_name) @@ -272,20 +272,20 @@ class TestShowCreateTable(KuduTestSuite): self.assert_show_create_equals(cursor, """ CREATE TABLE {table} (c INT PRIMARY KEY) - DISTRIBUTE BY HASH (c) INTO 3 BUCKETS STORED AS KUDU""", + PARTITION BY HASH (c) INTO 3 BUCKETS STORED AS KUDU""", """ CREATE TABLE {db}.{{table}} ( c INT NOT NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION, PRIMARY KEY (c) ) - DISTRIBUTE BY HASH (c) INTO 3 BUCKETS + PARTITION BY HASH (c) INTO 3 BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_addr}')""".format( db=cursor.conn.db_name, kudu_addr=KUDU_MASTER_HOSTS)) self.assert_show_create_equals(cursor, """ CREATE TABLE {table} (c INT PRIMARY KEY, d STRING NULL) - DISTRIBUTE BY HASH (c) INTO 3 BUCKETS, RANGE (c) + PARTITION BY HASH (c) INTO 3 BUCKETS, RANGE (c) (PARTITION VALUES <= 1, PARTITION 1 < VALUES <= 2, PARTITION 2 < VALUES) STORED AS KUDU""", """ @@ -294,27 +294,27 @@ class TestShowCreateTable(KuduTestSuite): d STRING NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION, PRIMARY KEY (c) ) - DISTRIBUTE BY HASH (c) INTO 3 BUCKETS, RANGE (c) (...) + PARTITION BY HASH (c) INTO 3 BUCKETS, RANGE (c) (...) STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_addr}')""".format( db=cursor.conn.db_name, kudu_addr=KUDU_MASTER_HOSTS)) self.assert_show_create_equals(cursor, """ CREATE TABLE {table} (c INT ENCODING PLAIN_ENCODING, PRIMARY KEY (c)) - DISTRIBUTE BY HASH (c) INTO 3 BUCKETS STORED AS KUDU""", + PARTITION BY HASH (c) INTO 3 BUCKETS STORED AS KUDU""", """ CREATE TABLE {db}.{{table}} ( c INT NOT NULL ENCODING PLAIN_ENCODING COMPRESSION DEFAULT_COMPRESSION, PRIMARY KEY (c) ) - DISTRIBUTE BY HASH (c) INTO 3 BUCKETS + PARTITION BY HASH (c) INTO 3 BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_addr}')""".format( db=cursor.conn.db_name, kudu_addr=KUDU_MASTER_HOSTS)) self.assert_show_create_equals(cursor, """ CREATE TABLE {table} (c INT COMPRESSION LZ4, d STRING, PRIMARY KEY(c, d)) - DISTRIBUTE BY HASH (c) INTO 3 BUCKETS, HASH (d) INTO 3 BUCKETS, + PARTITION BY HASH (c) INTO 3 BUCKETS, HASH (d) INTO 3 BUCKETS, RANGE (c, d) (PARTITION VALUE = (1, 'aaa'), PARTITION VALUE = (2, 'bbb')) STORED AS KUDU""", """ @@ -323,14 +323,14 @@ class TestShowCreateTable(KuduTestSuite): d STRING NOT NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION, PRIMARY KEY (c, d) ) - DISTRIBUTE BY HASH (c) INTO 3 BUCKETS, HASH (d) INTO 3 BUCKETS, RANGE (c, d) (...) + PARTITION BY HASH (c) INTO 3 BUCKETS, HASH (d) INTO 3 BUCKETS, RANGE (c, d) (...) STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_addr}')""".format( db=cursor.conn.db_name, kudu_addr=KUDU_MASTER_HOSTS)) self.assert_show_create_equals(cursor, """ CREATE TABLE {table} (c INT, d STRING, e INT NULL DEFAULT 10, PRIMARY KEY(c, d)) - DISTRIBUTE BY RANGE (c) (PARTITION VALUES <= 1, PARTITION 1 < VALUES <= 2, + PARTITION BY RANGE (c) (PARTITION VALUES <= 1, PARTITION 1 < VALUES <= 2, PARTITION 2 < VALUES <= 3, PARTITION 3 < VALUES) STORED AS KUDU""", """ CREATE TABLE {db}.{{table}} ( @@ -339,7 +339,7 @@ class TestShowCreateTable(KuduTestSuite): e INT NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION DEFAULT 10, PRIMARY KEY (c, d) ) - DISTRIBUTE BY RANGE (c) (...) + PARTITION BY RANGE (c) (...) STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_addr}')""".format( db=cursor.conn.db_name, kudu_addr=KUDU_MASTER_HOSTS)) @@ -352,7 +352,7 @@ class TestShowCreateTable(KuduTestSuite): self.assert_show_create_equals(cursor, """ CREATE TABLE {{table}} (c INT PRIMARY KEY) - DISTRIBUTE BY HASH (c) INTO 3 BUCKETS + PARTITION BY HASH (c) INTO 3 BUCKETS STORED AS KUDU TBLPROPERTIES ({props})""".format(props=props), """ @@ -360,7 +360,7 @@ class TestShowCreateTable(KuduTestSuite): c INT NOT NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION, PRIMARY KEY (c) ) - DISTRIBUTE BY HASH (c) INTO 3 BUCKETS + PARTITION BY HASH (c) INTO 3 BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_addr}', {props})""".format( db=cursor.conn.db_name, kudu_addr=KUDU_MASTER_HOSTS, props=props)) @@ -371,7 +371,7 @@ class TestShowCreateTable(KuduTestSuite): self.assert_show_create_equals(cursor, """ CREATE TABLE {{table}} (c INT PRIMARY KEY) - DISTRIBUTE BY HASH (c) INTO 3 BUCKETS + PARTITION BY HASH (c) INTO 3 BUCKETS STORED AS KUDU TBLPROPERTIES ({props})""".format(props=props), """ @@ -379,7 +379,7 @@ class TestShowCreateTable(KuduTestSuite): c INT NOT NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION, PRIMARY KEY (c) ) - DISTRIBUTE BY HASH (c) INTO 3 BUCKETS + PARTITION BY HASH (c) INTO 3 BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.master_addresses'='{kudu_addr}')""".format( db=cursor.conn.db_name, kudu_addr=KUDU_MASTER_HOSTS)) @@ -421,7 +421,7 @@ class TestDropDb(KuduTestSuite): # Create a managed Kudu table managed_table_name = self.random_table_name() unique_cursor.execute(""" - CREATE TABLE %s (a INT PRIMARY KEY) DISTRIBUTE BY HASH (a) INTO 3 BUCKETS + CREATE TABLE %s (a INT PRIMARY KEY) PARTITION BY HASH (a) INTO 3 BUCKETS STORED AS KUDU TBLPROPERTIES ('kudu.table_name' = '%s')""" % (managed_table_name, managed_table_name)) assert kudu_client.table_exists(managed_table_name) @@ -506,7 +506,7 @@ class TestImpalaKuduIntegration(KuduTestSuite): """Check that dropping a managed Kudu table works even if the underlying Kudu table has been dropped externally.""" impala_tbl_name = "foo" - cursor.execute("""CREATE TABLE %s.%s (a INT PRIMARY KEY) DISTRIBUTE BY HASH (a) + cursor.execute("""CREATE TABLE %s.%s (a INT PRIMARY KEY) PARTITION BY HASH (a) INTO 3 BUCKETS STORED AS KUDU""" % (unique_database, impala_tbl_name)) kudu_tbl_name = "impala::%s.%s" % (unique_database, impala_tbl_name) assert kudu_client.table_exists(kudu_tbl_name) @@ -545,7 +545,7 @@ class TestKuduMemLimits(KuduTestSuite): l_shipmode STRING, l_comment STRING, PRIMARY KEY (l_orderkey, l_linenumber)) - DISTRIBUTE BY HASH (l_orderkey, l_linenumber) INTO 3 BUCKETS + PARTITION BY HASH (l_orderkey, l_linenumber) INTO 3 BUCKETS STORED AS KUDU""" LOAD = """ http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cba93f1a/tests/shell/test_shell_commandline.py ---------------------------------------------------------------------- diff --git a/tests/shell/test_shell_commandline.py b/tests/shell/test_shell_commandline.py index 5b9859c..88deed0 100644 --- a/tests/shell/test_shell_commandline.py +++ b/tests/shell/test_shell_commandline.py @@ -478,7 +478,7 @@ class TestImpalaShell(ImpalaTestSuite): def test_kudu_dml_reporting(self, unique_database): db = unique_database run_impala_shell_cmd('--query="create table %s.dml_test (id int primary key, '\ - 'age int null) distribute by hash(id) into 2 buckets stored as kudu"' % db) + 'age int null) partition by hash(id) into 2 buckets stored as kudu"' % db) self._validate_dml_stmt("insert into %s.dml_test (id) values (7), (7)" % db, 1, 1) self._validate_dml_stmt("insert into %s.dml_test (id) values (7)" % db, 0, 1)