You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by cs...@apache.org on 2020/04/08 12:48:35 UTC
[impala] 02/02: IMPALA-9607: Fix test_column_storage_attributes
Kudu test
This is an automated email from the ASF dual-hosted git repository.
csringhofer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit 928d5879c701f66ca01a6b1778cdf4ac79133e89
Author: Grant Henke <gh...@cloudera.com>
AuthorDate: Mon Apr 6 19:23:25 2020 -0500
IMPALA-9607: Fix test_column_storage_attributes Kudu test
This patch fixes the test_column_storage_attributes test for Kudu tables
by removing the type attributes from the VARCHAR column name.
I tested this fix in my development environment by running test_kudu.py
with `--exploration_strategy exhaustive`.
Change-Id: I1b69a342a5b144beceefd17fb5a84547a1ae0103
Reviewed-on: http://gerrit.cloudera.org:8080/15674
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Alice Fan <fa...@gmail.com>
Reviewed-by: Csaba Ringhofer <cs...@cloudera.com>
---
tests/query_test/test_kudu.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tests/query_test/test_kudu.py b/tests/query_test/test_kudu.py
index 67436f0..a0b072f 100644
--- a/tests/query_test/test_kudu.py
+++ b/tests/query_test/test_kudu.py
@@ -413,7 +413,8 @@ class TestKuduOperations(KuduTestSuite):
cursor.execute("set kudu_read_mode=READ_AT_SNAPSHOT")
create_query = "create table %s (id int primary key" % table_name
for t in types:
- create_query += ", %s_col %s" % (t, t)
+ # We truncate the type attributes in the column name to keep things simple.
+ create_query += ", %s_col %s" % (t.split('(')[0], t)
create_query += ") partition by hash(id) partitions 16 stored as kudu"
cursor.execute(create_query)
@@ -425,8 +426,9 @@ class TestKuduOperations(KuduTestSuite):
for c in compressions:
for t in types:
try:
+ # We truncate the type attributes in the column name to keep things simple.
cursor.execute("""alter table %s alter column %s_col
- set encoding %s compression %s""" % (table_name, t, e, c))
+ set encoding %s compression %s""" % (table_name, t.split('(')[0], e, c))
except Exception as err:
assert "encoding %s not supported for type" % e in str(err)
cursor.execute("""insert into %s values (%s, true, 0, 0, 0, 0, 0, 0, '0',
@@ -435,7 +437,7 @@ class TestKuduOperations(KuduTestSuite):
cursor.execute("select * from %s where id = %s" % (table_name, i))
assert cursor.fetchall() == \
[(i, True, 0, 0, 0, 0, 0.0, 0.0, '0', datetime(2009, 1, 1, 0, 0), 0,
- '2010-01-01')]
+ '2010-01-01', '')]
i += 1
cursor.execute("select count(*) from %s" % table_name)
print cursor.fetchall() == [(i, )]