mirror of
https://github.com/apache/impala.git
synced 2025-12-25 02:03:09 -05:00
This patch changes the way test validate num inserted rows from checking the beeswax-specific result to checking NumModifiedRows counter from query profile. Remove skiping over hs2 protocol in test_chars.py and refactor test_date_queries.py a bit to reduce test skiping. Added HS2_TYPES in tests that requires it and fix some flake8 issues. Testing: Run and pass all affected tests. Change-Id: I96eae9967298f75b2c9e4d0662fcd4a62bf5fffc Reviewed-on: http://gerrit.cloudera.org:8080/22770 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Riza Suminto <riza.suminto@cloudera.com>
75 lines
1.7 KiB
Plaintext
75 lines
1.7 KiB
Plaintext
====
|
|
---- QUERY
|
|
# test querying text table with:
|
|
# fields terminated by ','
|
|
# escaped by '\\'
|
|
# lines terminated by '\n'
|
|
select * from functional.text_comma_backslash_newline
|
|
---- RESULTS
|
|
'one','two',3,4
|
|
'one,one','two',3,4
|
|
'one\\','two',3,4
|
|
'one\\,one','two',3,4
|
|
'one\\\\','two',3,4
|
|
---- TYPES
|
|
STRING,STRING,INT,INT
|
|
====
|
|
---- QUERY
|
|
# test querying text table with:
|
|
# fields terminated by '$'
|
|
# escaped by '#'
|
|
# lines terminated by '|'
|
|
select * from functional.text_dollar_hash_pipe
|
|
---- RESULTS
|
|
'one','two',3,4
|
|
'one$one','two',3,4
|
|
'one#','two',3,4
|
|
'one#$one','two',3,4
|
|
'one##','two',3,4
|
|
---- TYPES
|
|
STRING,STRING,INT,INT
|
|
====
|
|
---- QUERY
|
|
# create new tables like the ones above to test inserting
|
|
create table cbn like functional.text_comma_backslash_newline;
|
|
create table dhp like functional.text_dollar_hash_pipe;
|
|
---- RESULTS
|
|
'Table has been created.'
|
|
====
|
|
---- QUERY
|
|
# insert data into cbn table and check results
|
|
insert into cbn values
|
|
('abc , abc', 'xyz \\ xyz', 1, 2),
|
|
('abc ,,, abc', 'xyz \\\\\\ xyz', 3, 4),
|
|
('abc \\,\\, abc', 'xyz ,\\,\\ xyz', 5, 6)
|
|
---- RUNTIME_PROFILE
|
|
NumModifiedRows: 3
|
|
====
|
|
---- QUERY
|
|
select * from cbn
|
|
---- RESULTS
|
|
'abc , abc','xyz \\ xyz',1,2
|
|
'abc ,,, abc','xyz \\\\\\ xyz',3,4
|
|
'abc \\,\\, abc','xyz ,\\,\\ xyz',5,6
|
|
---- TYPES
|
|
STRING,STRING,INT,INT
|
|
====
|
|
---- QUERY
|
|
# insert data into dhp table and check results
|
|
insert into dhp values
|
|
('abc $ abc', 'xyz # xyz', 1, 2),
|
|
('abc $$$ abc', 'xyz ### xyz', 3, 4),
|
|
('abc #$#$ abc', 'xyz $#$# xyz', 5, 6)
|
|
---- RUNTIME_PROFILE
|
|
NumModifiedRows: 3
|
|
====
|
|
---- QUERY
|
|
select * from dhp
|
|
---- RESULTS
|
|
'abc $ abc','xyz # xyz',1,2
|
|
'abc $$$ abc','xyz ### xyz',3,4
|
|
'abc #$#$ abc','xyz $#$# xyz',5,6
|
|
---- TYPES
|
|
STRING,STRING,INT,INT
|
|
====
|