You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2019/05/10 19:02:11 UTC
[impala] branch master updated: IMPALA-8524: Avoid calling "hive"
via command line in EE tests
This is an automated email from the ASF dual-hosted git repository.
tarmstrong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
The following commit(s) were added to refs/heads/master by this push:
new e57fd17 IMPALA-8524: Avoid calling "hive" via command line in EE tests
e57fd17 is described below
commit e57fd17cd99bd1680480dad6de769d0ef57aaacb
Author: Csaba Ringhofer <cs...@cloudera.com>
AuthorDate: Wed May 8 17:28:44 2019 +0200
IMPALA-8524: Avoid calling "hive" via command line in EE tests
"hive -e SQL..." without further parameters no longer works
when USE_CDP_HIVE=true (it doesn't establish a connection).
Some tests used this to load data.
These calls can be replaced with ImpalaTestSuite.run_stmt_in_hive()
which seems like a good idea regardless of the Hive 3 efforts.
Testing:
- ran the related tests (some run only in exhustive mode)
Change-Id: I874ac344ffd176ffd7b8540d57126a7026f4c4f6
Reviewed-on: http://gerrit.cloudera.org:8080/13282
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Csaba Ringhofer <cs...@cloudera.com>
---
tests/custom_cluster/test_parquet_max_page_header.py | 3 +--
tests/metadata/test_compute_stats.py | 2 +-
tests/query_test/test_compressed_formats.py | 4 ++--
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/tests/custom_cluster/test_parquet_max_page_header.py b/tests/custom_cluster/test_parquet_max_page_header.py
index 59e87fb..0c107b2 100644
--- a/tests/custom_cluster/test_parquet_max_page_header.py
+++ b/tests/custom_cluster/test_parquet_max_page_header.py
@@ -73,8 +73,7 @@ class TestParquetMaxPageHeader(CustomClusterTestSuite):
.format(self.PARQUET_TABLE_NAME, self.TEXT_TABLE_NAME)
# Impala parquet-writer doesn't write/use page statistics. So we use hive
# to write these files
- hive_cmd = "hive -e " + insert_cmd
- subprocess.call(hive_cmd, shell=True)
+ self.run_stmt_in_hive(insert_cmd)
def __generate_test_data(self, dir, file):
"""Creates a file in HDFS containing two MAX_STRING_LENGTH lines."""
diff --git a/tests/metadata/test_compute_stats.py b/tests/metadata/test_compute_stats.py
index 7ae05f6..c15a433 100644
--- a/tests/metadata/test_compute_stats.py
+++ b/tests/metadata/test_compute_stats.py
@@ -135,7 +135,7 @@ class TestComputeStats(ImpalaTestSuite):
insert overwrite table {0}.{1} partition (p1=1, p2="pval")
select id from functional.alltypestiny;
""".format(unique_database, table_name)
- check_call(["hive", "-e", create_load_data_stmts])
+ self.run_stmt_in_hive(create_load_data_stmts)
# Make the table visible in Impala.
self.execute_query("invalidate metadata %s.%s" % (unique_database, table_name))
diff --git a/tests/query_test/test_compressed_formats.py b/tests/query_test/test_compressed_formats.py
index 97a8782..926889b 100644
--- a/tests/query_test/test_compressed_formats.py
+++ b/tests/query_test/test_compressed_formats.py
@@ -111,7 +111,7 @@ class TestCompressedFormats(ImpalaTestSuite):
hive_cmd = drop_cmd + 'CREATE TABLE %s LIKE %s;' % (dest_table, src_table)
# Create the table
- call(["hive", "-e", hive_cmd]);
+ self.run_stmt_in_hive(hive_cmd)
call(["hadoop", "fs", "-cp", src_file, dest_file])
# Try to read the compressed file with extension
query = 'select count(*) from %s' % dest_table
@@ -128,7 +128,7 @@ class TestCompressedFormats(ImpalaTestSuite):
print "Unexpected error:\n%s", error_msg
raise
finally:
- call(["hive", "-e", drop_cmd]);
+ self.run_stmt_in_hive(drop_cmd)
class TestUnsupportedTableWriters(ImpalaTestSuite):
@classmethod