You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ph...@apache.org on 2018/01/23 00:42:48 UTC
[5/5] impala git commit: IMPALA-6420: Fix TestCharFormats for local
filesystem tests
IMPALA-6420: Fix TestCharFormats for local filesystem tests
Tl;dr - running tests was covering up a bug in the tests,
or alternatively, not running tests exposes a bug.
Local tests were failing because we failed to prepend
the local filesystem prefix. This was covered up because
the snapshot creation job runs tests, which actually creates
these tables in the metastore. When running local filesystem
tests with a snapshot, the table creation never runs because
the snapshot import converts hdfs:// locations into local
file locations. The problematic CREATE TABLE x IF NOT EXISTS
then never get run, hiding the problem.
Testing: With a local filesystem install, in Impala shell:
drop table functional_parquet.chars_formats
and then:
tests/run-tests.py query_test/test_chars.py -k char_format
Change-Id: I916b5566a3c5a83185e502b814ad43b5af14e87f
Reviewed-on: http://gerrit.cloudera.org:8080/9074
Reviewed-by: Alex Behm <al...@cloudera.com>
Tested-by: Impala Public Jenkins
Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/8f0ef09a
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/8f0ef09a
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/8f0ef09a
Branch: refs/heads/2.x
Commit: 8f0ef09a8a41e8073223abff189b91ce7aeff080
Parents: 38a9ab7
Author: Zachary Amsden <za...@cloudera.com>
Authored: Thu Jan 18 13:44:27 2018 -0800
Committer: Philip Zeyliger <ph...@cloudera.com>
Committed: Mon Jan 22 16:41:16 2018 -0800
----------------------------------------------------------------------
tests/query_test/test_chars.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/impala/blob/8f0ef09a/tests/query_test/test_chars.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_chars.py b/tests/query_test/test_chars.py
index eaa744a..b182b91 100644
--- a/tests/query_test/test_chars.py
+++ b/tests/query_test/test_chars.py
@@ -19,6 +19,7 @@ import pytest
from tests.common.impala_test_suite import ImpalaTestSuite
from tests.common.test_dimensions import create_exec_option_dimension
+from tests.util.filesystem_utils import get_fs_path
class TestStringQueries(ImpalaTestSuite):
@classmethod
@@ -54,25 +55,25 @@ class TestCharFormats(ImpalaTestSuite):
functional_parquet.chars_formats
(cs CHAR(5), cl CHAR(140), vc VARCHAR(32))
STORED AS PARQUET
- LOCATION "/test-warehouse/chars_formats_parquet"''')
+ LOCATION "{0}"'''.format(get_fs_path("/test-warehouse/chars_formats_parquet")))
self.client.execute('''create external table if not exists
functional.chars_formats
(cs CHAR(5), cl CHAR(140), vc VARCHAR(32))
ROW FORMAT delimited fields terminated by ',' escaped by '\\\\'
STORED AS TEXTFILE
- LOCATION "/test-warehouse/chars_formats_text"
- ''')
+ LOCATION "{0}"'''.format(get_fs_path("/test-warehouse/chars_formats_text")))
self.client.execute('''create external table if not exists
functional_avro_snap.chars_formats
(cs CHAR(5), cl CHAR(140), vc VARCHAR(32))
STORED AS AVRO
- LOCATION "/test-warehouse/chars_formats_avro_snap"
- TBLPROPERTIES ('avro.schema.literal'='{"type":"record",
+ LOCATION "{0}"
+ TBLPROPERTIES ('avro.schema.literal'='{{"type":"record",
"name":"CharTypesTest","doc":"Schema generated by Kite",
"fields":[
- {"name":"cs","type":["null","string"], "doc":"Type inferred"},
- {"name":"cl","type":["null","string"], "doc":"Type inferred"},
- {"name":"vc","type":["null","string"],"doc":"Type inferred"}]}')''')
+ {{"name":"cs","type":["null","string"], "doc":"Type inferred"}},
+ {{"name":"cl","type":["null","string"], "doc":"Type inferred"}},
+ {{"name":"vc","type":["null","string"],"doc":"Type inferred"}}]}}')
+ '''.format(get_fs_path("/test-warehouse/chars_formats_avro_snap")))
@classmethod
def add_test_dimensions(cls):