You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by st...@apache.org on 2021/04/21 00:44:12 UTC
[impala] 02/02: IMPALA-10662: Change EE tests to return the same
results for HS2 as Beeswax
This is an automated email from the ASF dual-hosted git repository.
stigahuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit 9355b25e118bd057396bdc36aee47d6e54c7d5cf
Author: Csaba Ringhofer <cs...@cloudera.com>
AuthorDate: Mon Apr 19 23:06:31 2021 +0200
IMPALA-10662: Change EE tests to return the same results for HS2 as Beeswax
In EE tests HS2 returned results with smaller precision than Beeswax for
FLOAT/DOUBLE/TIMESTAMP types. These differences are not inherent to the
HS2 protocol - the results are returned with full precision in Thrift
and lose precision during conversion in client code.
This patch changes to conversion in HS2 to match Beeswax and removes
test section DBAPI_RESULTS that was used to handle the differences:
- float/double: print method is changed from str() to ":.16".format()
- timestamp: impyla's cursor is created with convert_types=False to
avoid conversion to datetime.datetime (which has only
microsec precision)
Note that FLOAT/DOUBLE are still different in impala-shell, this change
only deals with EE tests.
Testing:
- ran the changed tests
Change-Id: If69ae90c6333ff245c2b951af5689e3071f85cb2
Reviewed-on: http://gerrit.cloudera.org:8080/17325
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
.../queries/QueryTest/analytic-fns.test | 7 --
.../queries/QueryTest/data-source-tables.test | 10 --
.../queries/QueryTest/inline-view-limit.test | 18 ---
.../queries/QueryTest/inline-view.test | 12 --
.../functional-query/queries/QueryTest/limit.test | 55 ----------
.../queries/QueryTest/subquery.test | 13 ---
.../functional-query/queries/QueryTest/top-n.test | 122 ---------------------
tests/common/impala_connection.py | 10 +-
tests/common/impala_test_suite.py | 8 +-
tests/util/test_file_parser.py | 2 +-
10 files changed, 8 insertions(+), 249 deletions(-)
diff --git a/testdata/workloads/functional-query/queries/QueryTest/analytic-fns.test b/testdata/workloads/functional-query/queries/QueryTest/analytic-fns.test
index 4450d07..fc1dce4 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/analytic-fns.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/analytic-fns.test
@@ -1885,13 +1885,6 @@ INT, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, STRING, TIMESTAMP
2,true,2,2,2,20,2.200000047683716,20.2,'2',2010-01-01 00:02:00.100000000
3,false,3,3,3,30,3.299999952316284,30.3,'3',2010-01-01 00:03:00.300000000
4,true,4,4,4,40,4.400000095367432,40.4,'4',2010-01-01 00:04:00.600000000
----- DBAPI_RESULTS: VERIFY_IS_EQUAL_SORTED
-0,true,NULL,NULL,NULL,NULL,NULL,NULL,'0',2010-01-01 00:00:00
-0,true,NULL,NULL,NULL,NULL,NULL,NULL,'0',2010-01-01 00:00:00
-1,false,1,1,1,10,1.100000023841858,10.1,'1',2010-01-01 00:01:00
-2,true,2,2,2,20,2.200000047683716,20.2,'2',2010-01-01 00:02:00.100000
-3,false,3,3,3,30,3.299999952316284,30.3,'3',2010-01-01 00:03:00.300000
-4,true,4,4,4,40,4.400000095367432,40.4,'4',2010-01-01 00:04:00.600000
====
---- QUERY
# Test all possible types for first_value (except decimal).
diff --git a/testdata/workloads/functional-query/queries/QueryTest/data-source-tables.test b/testdata/workloads/functional-query/queries/QueryTest/data-source-tables.test
index 6417288..d1469e8 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/data-source-tables.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/data-source-tables.test
@@ -13,12 +13,6 @@ where float_col != 0 and
1992,true,2,92,1992,19920,2191.199951171875,1992,1970-01-01 00:00:01.992000000,'1992',-999998007,-9999998007,-9999999999.9999998007,-9.9999999999999999999999999999999998007,-99999.98007,1975-06-16
1993,false,3,93,1993,19930,2192.300048828125,1993,1970-01-01 00:00:01.993000000,'1993',999998006,9999998006,9999999999.9999998006,9.9999999999999999999999999999999998006,99999.98006,1975-06-17
1994,true,4,94,1994,19940,2193.39990234375,1994,1970-01-01 00:00:01.994000000,'1994',-999998005,-9999998005,-9999999999.9999998005,-9.9999999999999999999999999999999998005,-99999.98005,1975-06-18
----- DBAPI_RESULTS
-1990,true,0,90,1990,19900,2189,1990,1970-01-01 00:00:01.990000,'NULL',-999998009,-9999998009,-9999999999.9999998009,-9.9999999999999999999999999999999998009,-99999.98009,1975-06-14
-1991,false,1,91,1991,19910,2190.10009765625,1991,1970-01-01 00:00:01.991000,'1991',999998008,9999998008,9999999999.9999998008,9.9999999999999999999999999999999998008,99999.98008,1975-06-15
-1992,true,2,92,1992,19920,2191.199951171875,1992,1970-01-01 00:00:01.992000,'1992',-999998007,-9999998007,-9999999999.9999998007,-9.9999999999999999999999999999999998007,-99999.98007,1975-06-16
-1993,false,3,93,1993,19930,2192.300048828125,1993,1970-01-01 00:00:01.993000,'1993',999998006,9999998006,9999999999.9999998006,9.9999999999999999999999999999999998006,99999.98006,1975-06-17
-1994,true,4,94,1994,19940,2193.39990234375,1994,1970-01-01 00:00:01.994000,'1994',-999998005,-9999998005,-9999999999.9999998005,-9.9999999999999999999999999999999998005,-99999.98005,1975-06-18
---- TYPES
INT, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, TIMESTAMP, STRING, DECIMAL, DECIMAL, DECIMAL, DECIMAL, DECIMAL, DATE
====
@@ -31,10 +25,6 @@ where double_col != 0 and int_col >= 1990 limit 3
19900,1970-01-01 00:00:01.990000000,1990
19910,1970-01-01 00:00:01.991000000,1991
19920,1970-01-01 00:00:01.992000000,1992
----- DBAPI_RESULTS
-19900,1970-01-01 00:00:01.990000,1990
-19910,1970-01-01 00:00:01.991000,1991
-19920,1970-01-01 00:00:01.992000,1992
---- TYPES
BIGINT, TIMESTAMP, DOUBLE
====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/inline-view-limit.test b/testdata/workloads/functional-query/queries/QueryTest/inline-view-limit.test
index a483f4f..b7d6426 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/inline-view-limit.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/inline-view-limit.test
@@ -21,12 +21,6 @@ INT, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, STRING, STRING, TIM
4,true,4,4,4,40,4.400000095367432,40.4,'01/01/09','4',2009-01-01 00:04:00.600000000,2009,1
6,true,6,6,6,60,6.599999904632568,60.6,'01/01/09','6',2009-01-01 00:06:00.150000000,2009,1
8,true,8,8,8,80,8.800000190734863,80.8,'01/01/09','8',2009-01-01 00:08:00.280000000,2009,1
----- DBAPI_RESULTS
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-2,true,2,2,2,20,2.200000047683716,20.2,'01/01/09','2',2009-01-01 00:02:00.100000,2009,1
-4,true,4,4,4,40,4.400000095367432,40.4,'01/01/09','4',2009-01-01 00:04:00.600000,2009,1
-6,true,6,6,6,60,6.599999904632568,60.6,'01/01/09','6',2009-01-01 00:06:00.150000,2009,1
-8,true,8,8,8,80,8.800000190734863,80.8,'01/01/09','8',2009-01-01 00:08:00.280000,2009,1
====
---- QUERY
# order by/limit in subquery, followed by addititional selection predicate;
@@ -45,12 +39,6 @@ INT, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, STRING, STRING, TIM
4,true,4,4,4,40,4.400000095367432,40.4,'01/01/09','4',2009-01-01 00:04:00.600000000,2009,1
6,true,6,6,6,60,6.599999904632568,60.6,'01/01/09','6',2009-01-01 00:06:00.150000000,2009,1
8,true,8,8,8,80,8.800000190734863,80.8,'01/01/09','8',2009-01-01 00:08:00.280000000,2009,1
----- DBAPI_RESULTS
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-2,true,2,2,2,20,2.200000047683716,20.2,'01/01/09','2',2009-01-01 00:02:00.100000,2009,1
-4,true,4,4,4,40,4.400000095367432,40.4,'01/01/09','4',2009-01-01 00:04:00.600000,2009,1
-6,true,6,6,6,60,6.599999904632568,60.6,'01/01/09','6',2009-01-01 00:06:00.150000,2009,1
-8,true,8,8,8,80,8.800000190734863,80.8,'01/01/09','8',2009-01-01 00:08:00.280000,2009,1
====
---- QUERY
# join against subquery with limit creates a merge fragment that applies the limit
@@ -114,12 +102,6 @@ double_col, date_string_col, string_col, timestamp_col, year, month from
2,true,2,2,2,20,2.200000047683716,20.2,'01/01/09','2',2009-01-01 00:02:00.100000000,2009,1
3,false,3,3,3,30,3.299999952316284,30.3,'01/01/09','3',2009-01-01 00:03:00.300000000,2009,1
4,true,4,4,4,40,4.400000095367432,40.4,'01/01/09','4',2009-01-01 00:04:00.600000000,2009,1
----- DBAPI_RESULTS
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-1,false,1,1,1,10,1.100000023841858,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-2,true,2,2,2,20,2.200000047683716,20.2,'01/01/09','2',2009-01-01 00:02:00.100000,2009,1
-3,false,3,3,3,30,3.299999952316284,30.3,'01/01/09','3',2009-01-01 00:03:00.300000,2009,1
-4,true,4,4,4,40,4.400000095367432,40.4,'01/01/09','4',2009-01-01 00:04:00.600000,2009,1
---- TYPES
INT, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, STRING, STRING, TIMESTAMP, INT, INT
====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/inline-view.test b/testdata/workloads/functional-query/queries/QueryTest/inline-view.test
index 299db84..2cbda7b 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/inline-view.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/inline-view.test
@@ -151,12 +151,6 @@ where month = 1
2,3,2,true,2,2,2,20,2.200000047683716,20.2,'01/01/09','2',2009-01-01 00:02:00.100000000,2009,1
3,3,3,false,3,3,3,30,3.299999952316284,30.3,'01/01/09','3',2009-01-01 00:03:00.300000000,2009,1
4,3,4,true,4,4,4,40,4.400000095367432,40.4,'01/01/09','4',2009-01-01 00:04:00.600000000,2009,1
----- DBAPI_RESULTS: VERIFY_IS_EQUAL_SORTED
-0,3,0,True,0,0,0,0,0.0,0.0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-1,3,1,False,1,1,1,10,1.10000002384,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-2,3,2,True,2,2,2,20,2.20000004768,20.2,'01/01/09','2',2009-01-01 00:02:00.100000,2009,1
-3,3,3,False,3,3,3,30,3.29999995232,30.3,'01/01/09','3',2009-01-01 00:03:00.300000,2009,1
-4,3,4,True,4,4,4,40,4.40000009537,40.4,'01/01/09','4',2009-01-01 00:04:00.600000,2009,1
---- TYPES
int, bigint, int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int
====
@@ -182,12 +176,6 @@ where month = 1
2,3,2,true,2,2,2,20,2.200000047683716,20.2,'01/01/09','2',2009-01-01 00:02:00.100000000,2009,1
3,3,3,false,3,3,3,30,3.299999952316284,30.3,'01/01/09','3',2009-01-01 00:03:00.300000000,2009,1
4,3,4,true,4,4,4,40,4.400000095367432,40.4,'01/01/09','4',2009-01-01 00:04:00.600000000,2009,1
----- DBAPI_RESULTS
-0,3,0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-1,3,1,false,1,1,1,10,1.100000023841858,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-2,3,2,true,2,2,2,20,2.200000047683716,20.2,'01/01/09','2',2009-01-01 00:02:00.100000,2009,1
-3,3,3,false,3,3,3,30,3.299999952316284,30.3,'01/01/09','3',2009-01-01 00:03:00.300000,2009,1
-4,3,4,true,4,4,4,40,4.400000095367432,40.4,'01/01/09','4',2009-01-01 00:04:00.600000,2009,1
---- TYPES
int, bigint, int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int
====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/limit.test b/testdata/workloads/functional-query/queries/QueryTest/limit.test
index c11c328..0ba186b 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/limit.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/limit.test
@@ -46,17 +46,6 @@ select * from (select * from alltypesagg where day = 1 order by id limit 10) a l
7,false,7,7,7,70,7.699999809265137,70.7,'01/01/10','7',2010-01-01 00:07:00.210000000,2010,1,1
8,true,8,8,8,80,8.800000190734863,80.8,'01/01/10','8',2010-01-01 00:08:00.280000000,2010,1,1
9,false,9,9,9,90,9.899999618530273,90.90000000000001,'01/01/10','9',2010-01-01 00:09:00.360000000,2010,1,1
----- DBAPI_RESULTS : VERIFY_IS_EQUAL_SORTED
-0,true,NULL,NULL,NULL,NULL,NULL,NULL,'01/01/10','0',2010-01-01 00:00:00,2010,1,1
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/10','1',2010-01-01 00:01:00,2010,1,1
-2,true,2,2,2,20,2.200000047683,20.2,'01/01/10','2',2010-01-01 00:02:00.100000,2010,1,1
-3,false,3,3,3,30,3.299999952316,30.3,'01/01/10','3',2010-01-01 00:03:00.300000,2010,1,1
-4,true,4,4,4,40,4.400000095367,40.4,'01/01/10','4',2010-01-01 00:04:00.600000,2010,1,1
-5,false,5,5,5,50,5.5,50.5,'01/01/10','5',2010-01-01 00:05:00.100000,2010,1,1
-6,true,6,6,6,60,6.599999904632,60.6,'01/01/10','6',2010-01-01 00:06:00.150000,2010,1,1
-7,false,7,7,7,70,7.699999809265,70.7,'01/01/10','7',2010-01-01 00:07:00.210000,2010,1,1
-8,true,8,8,8,80,8.800000190734,80.8,'01/01/10','8',2010-01-01 00:08:00.280000,2010,1,1
-9,false,9,9,9,90,9.899999618530,90.90000000000001,'01/01/10','9',2010-01-01 00:09:00.360000,2010,1,1
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int, int
====
@@ -74,17 +63,6 @@ select * from alltypesagg where day = 1 order by id limit 10
7,false,7,7,7,70,7.699999809265137,70.7,'01/01/10','7',2010-01-01 00:07:00.210000000,2010,1,1
8,true,8,8,8,80,8.800000190734863,80.8,'01/01/10','8',2010-01-01 00:08:00.280000000,2010,1,1
9,false,9,9,9,90,9.899999618530273,90.90000000000001,'01/01/10','9',2010-01-01 00:09:00.360000000,2010,1,1
----- DBAPI_RESULTS
-0,true,NULL,NULL,NULL,NULL,NULL,NULL,'01/01/10','0',2010-01-01 00:00:00,2010,1,1
-1,false,1,1,1,10,1.100000023841858,10.1,'01/01/10','1',2010-01-01 00:01:00,2010,1,1
-2,true,2,2,2,20,2.200000047683716,20.2,'01/01/10','2',2010-01-01 00:02:00.100000,2010,1,1
-3,false,3,3,3,30,3.299999952316284,30.3,'01/01/10','3',2010-01-01 00:03:00.300000,2010,1,1
-4,true,4,4,4,40,4.400000095367432,40.4,'01/01/10','4',2010-01-01 00:04:00.600000,2010,1,1
-5,false,5,5,5,50,5.5,50.5,'01/01/10','5',2010-01-01 00:05:00.100000,2010,1,1
-6,true,6,6,6,60,6.599999904632568,60.6,'01/01/10','6',2010-01-01 00:06:00.150000,2010,1,1
-7,false,7,7,7,70,7.699999809265137,70.7,'01/01/10','7',2010-01-01 00:07:00.210000,2010,1,1
-8,true,8,8,8,80,8.800000190734863,80.8,'01/01/10','8',2010-01-01 00:08:00.280000,2010,1,1
-9,false,9,9,9,90,9.899999618530273,90.90000000000001,'01/01/10','9',2010-01-01 00:09:00.360000,2010,1,1
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int, int
====
@@ -102,17 +80,6 @@ select * from alltypesagg where tinyint_col is null and day = 1 order by id limi
70,true,NULL,70,70,700,77,707,'01/01/10','70',2010-01-01 01:10:24.150000000,2010,1,1
80,true,NULL,80,80,800,88,808,'01/01/10','80',2010-01-01 01:20:31.600000000,2010,1,1
90,true,NULL,90,90,900,99,909,'01/01/10','90',2010-01-01 01:30:40.500000000,2010,1,1
----- DBAPI_RESULTS
-0,true,NULL,NULL,NULL,NULL,NULL,NULL,'01/01/10','0',2010-01-01 00:00:00,2010,1,1
-10,true,NULL,10,10,100,11,101,'01/01/10','10',2010-01-01 00:10:00.450000,2010,1,1
-20,true,NULL,20,20,200,22,202,'01/01/10','20',2010-01-01 00:20:01.900000,2010,1,1
-30,true,NULL,30,30,300,33,303,'01/01/10','30',2010-01-01 00:30:04.350000,2010,1,1
-40,true,NULL,40,40,400,44,404,'01/01/10','40',2010-01-01 00:40:07.800000,2010,1,1
-50,true,NULL,50,50,500,55,505,'01/01/10','50',2010-01-01 00:50:12.250000,2010,1,1
-60,true,NULL,60,60,600,66,606,'01/01/10','60',2010-01-01 01:00:17.700000,2010,1,1
-70,true,NULL,70,70,700,77,707,'01/01/10','70',2010-01-01 01:10:24.150000,2010,1,1
-80,true,NULL,80,80,800,88,808,'01/01/10','80',2010-01-01 01:20:31.600000,2010,1,1
-90,true,NULL,90,90,900,99,909,'01/01/10','90',2010-01-01 01:30:40.500000,2010,1,1
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int, int
====
@@ -280,17 +247,6 @@ select * from alltypesagg where id != 0 and id != 10 order by id limit 10 offset
8,true,8,8,8,80,8.800000190734863,80.8,'01/01/10','8',2010-01-01 00:08:00.280000000,2010,1,1
9,false,9,9,9,90,9.899999618530273,90.89999999999999,'01/01/10','9',2010-01-01 00:09:00.360000000,2010,1,1
11,false,1,11,11,110,12.10000038146973,111.1,'01/01/10','11',2010-01-01 00:11:00.550000000,2010,1,1
----- DBAPI_RESULTS
-1,false,1,1,1,10,1.100000023841858,10.1,'01/01/10','1',2010-01-01 00:01:00,2010,1,1
-2,true,2,2,2,20,2.200000047683716,20.2,'01/01/10','2',2010-01-01 00:02:00.100000,2010,1,1
-3,false,3,3,3,30,3.299999952316284,30.3,'01/01/10','3',2010-01-01 00:03:00.300000,2010,1,1
-4,true,4,4,4,40,4.400000095367432,40.4,'01/01/10','4',2010-01-01 00:04:00.600000,2010,1,1
-5,false,5,5,5,50,5.5,50.5,'01/01/10','5',2010-01-01 00:05:00.100000,2010,1,1
-6,true,6,6,6,60,6.599999904632568,60.59999999999999,'01/01/10','6',2010-01-01 00:06:00.150000,2010,1,1
-7,false,7,7,7,70,7.699999809265137,70.7,'01/01/10','7',2010-01-01 00:07:00.210000,2010,1,1
-8,true,8,8,8,80,8.800000190734863,80.8,'01/01/10','8',2010-01-01 00:08:00.280000,2010,1,1
-9,false,9,9,9,90,9.899999618530273,90.89999999999999,'01/01/10','9',2010-01-01 00:09:00.360000,2010,1,1
-11,false,1,11,11,110,12.10000038146973,111.1,'01/01/10','11',2010-01-01 00:11:00.550000,2010,1,1
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int, int
====
@@ -308,17 +264,6 @@ select * from alltypesagg where id != 0 and id != 10 order by id limit 10 offset
14,true,4,14,14,140,15.39999961853027,141.4,'01/01/10','14',2010-01-01 00:14:00.910000000,2010,1,1
15,false,5,15,15,150,16.5,151.5,'01/01/10','15',2010-01-01 00:15:01.500000000,2010,1,1
16,true,6,16,16,160,17.60000038146973,161.6,'01/01/10','16',2010-01-01 00:16:01.200000000,2010,1,1
----- DBAPI_RESULTS
-6,true,6,6,6,60,6.599999904632568,60.59999999999999,'01/01/10','6',2010-01-01 00:06:00.150000,2010,1,1
-7,false,7,7,7,70,7.699999809265137,70.7,'01/01/10','7',2010-01-01 00:07:00.210000,2010,1,1
-8,true,8,8,8,80,8.800000190734863,80.8,'01/01/10','8',2010-01-01 00:08:00.280000,2010,1,1
-9,false,9,9,9,90,9.899999618530273,90.89999999999999,'01/01/10','9',2010-01-01 00:09:00.360000,2010,1,1
-11,false,1,11,11,110,12.10000038146973,111.1,'01/01/10','11',2010-01-01 00:11:00.550000,2010,1,1
-12,true,2,12,12,120,13.19999980926514,121.2,'01/01/10','12',2010-01-01 00:12:00.660000,2010,1,1
-13,false,3,13,13,130,14.30000019073486,131.3,'01/01/10','13',2010-01-01 00:13:00.780000,2010,1,1
-14,true,4,14,14,140,15.39999961853027,141.4,'01/01/10','14',2010-01-01 00:14:00.910000,2010,1,1
-15,false,5,15,15,150,16.5,151.5,'01/01/10','15',2010-01-01 00:15:01.500000,2010,1,1
-16,true,6,16,16,160,17.60000038146973,161.6,'01/01/10','16',2010-01-01 00:16:01.200000,2010,1,1
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int, int
====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/subquery.test b/testdata/workloads/functional-query/queries/QueryTest/subquery.test
index 6d3bcc1..ebe76dd 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/subquery.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/subquery.test
@@ -1338,19 +1338,6 @@ INT, TIMESTAMP
1027,2009-04-13 02:07:05.610000000
1028,2009-04-13 02:08:05.680000000
1029,2009-04-13 02:09:05.760000000
----- DBAPI_RESULTS
-0,2009-01-01 00:00:00
-1,2009-01-01 00:01:00
-1020,2009-04-13 02:00:05.400000
-1021,2009-04-13 02:01:05.400000
-1022,2009-04-13 02:02:05.410000
-1023,2009-04-13 02:03:05.430000
-1024,2009-04-13 02:04:05.460000
-1025,2009-04-13 02:05:05.500000
-1026,2009-04-13 02:06:05.550000
-1027,2009-04-13 02:07:05.610000
-1028,2009-04-13 02:08:05.680000
-1029,2009-04-13 02:09:05.760000
====
---- QUERY
# Subquery in OR predicate inside non-trivial expression.
diff --git a/testdata/workloads/functional-query/queries/QueryTest/top-n.test b/testdata/workloads/functional-query/queries/QueryTest/top-n.test
index 4c05a29..0992559 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/top-n.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/top-n.test
@@ -736,27 +736,6 @@ from alltypessmall order by 1 limit 20
2008-12-20 00:19:00.810000000,2009-02-02 00:19:00.810000000,44
2008-12-20 00:20:00.900000000,2009-02-03 00:20:00.900000000,45
2008-12-20 00:23:00.930000000,2009-03-03 00:23:00.930000000,73
----- DBAPI_RESULTS
-2008-12-10 00:24:00.960000,2009-01-03 00:24:00.960000,24
-2008-12-11 00:23:00.930000,2009-01-03 00:23:00.930000,23
-2008-12-12 00:22:00.910000,2009-01-03 00:22:00.910000,22
-2008-12-13 00:21:00.900000,2009-01-03 00:21:00.900000,21
-2008-12-14 00:19:00.810000,2009-01-02 00:19:00.810000,19
-2008-12-14 00:20:00.900000,2009-01-03 00:20:00.900000,20
-2008-12-15 00:18:00.730000,2009-01-02 00:18:00.730000,18
-2008-12-16 00:17:00.660000,2009-01-02 00:17:00.660000,17
-2008-12-16 00:24:00.960000,2009-02-03 00:24:00.960000,49
-2008-12-17 00:16:00.600000,2009-01-02 00:16:00.600000,16
-2008-12-17 00:23:00.930000,2009-02-03 00:23:00.930000,48
-2008-12-18 00:15:00.550000,2009-01-02 00:15:00.550000,15
-2008-12-18 00:22:00.910000,2009-02-03 00:22:00.910000,47
-2008-12-19 00:14:00.510000,2009-01-02 00:14:00.510000,14
-2008-12-19 00:21:00.900000,2009-02-03 00:21:00.900000,46
-2008-12-19 00:24:00.960000,2009-03-03 00:24:00.960000,74
-2008-12-20 00:13:00.480000,2009-01-02 00:13:00.480000,13
-2008-12-20 00:19:00.810000,2009-02-02 00:19:00.810000,44
-2008-12-20 00:20:00.900000,2009-02-03 00:20:00.900000,45
-2008-12-20 00:23:00.930000,2009-03-03 00:23:00.930000,73
---- TYPES
TIMESTAMP, TIMESTAMP, INT
====
@@ -837,17 +816,6 @@ select * from alltypesagg where day is not null order by id limit 10 offset 0
7,false,7,7,7,70,7.699999809265137,70.7,'01/01/10','7',2010-01-01 00:07:00.210000000,2010,1,1
8,true,8,8,8,80,8.800000190734863,80.8,'01/01/10','8',2010-01-01 00:08:00.280000000,2010,1,1
9,false,9,9,9,90,9.899999618530273,90.89999999999999,'01/01/10','9',2010-01-01 00:09:00.360000000,2010,1,1
----- DBAPI_RESULTS
-0,true,NULL,NULL,NULL,NULL,NULL,NULL,'01/01/10','0',2010-01-01 00:00:00,2010,1,1
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/10','1',2010-01-01 00:01:00,2010,1,1
-2,true,2,2,2,20,2.200000047683,20.2,'01/01/10','2',2010-01-01 00:02:00.100000,2010,1,1
-3,false,3,3,3,30,3.299999952316,30.3,'01/01/10','3',2010-01-01 00:03:00.300000,2010,1,1
-4,true,4,4,4,40,4.400000095367,40.4,'01/01/10','4',2010-01-01 00:04:00.600000,2010,1,1
-5,false,5,5,5,50,5.5,50.5,'01/01/10','5',2010-01-01 00:05:00.100000,2010,1,1
-6,true,6,6,6,60,6.599999904632,60.59999999999999,'01/01/10','6',2010-01-01 00:06:00.150000,2010,1,1
-7,false,7,7,7,70,7.699999809265,70.7,'01/01/10','7',2010-01-01 00:07:00.210000,2010,1,1
-8,true,8,8,8,80,8.800000190734,80.8,'01/01/10','8',2010-01-01 00:08:00.280000,2010,1,1
-9,false,9,9,9,90,9.899999618530,90.89999999999999,'01/01/10','9',2010-01-01 00:09:00.360000,2010,1,1
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int, int
====
@@ -866,17 +834,6 @@ select * from alltypesagg where day is not null order by id limit 10 offset 5
12,true,2,12,12,120,13.19999980926514,121.2,'01/01/10','12',2010-01-01 00:12:00.660000000,2010,1,1
13,false,3,13,13,130,14.30000019073486,131.3,'01/01/10','13',2010-01-01 00:13:00.780000000,2010,1,1
14,true,4,14,14,140,15.39999961853027,141.4,'01/01/10','14',2010-01-01 00:14:00.910000000,2010,1,1
----- DBAPI_RESULTS
-5,false,5,5,5,50,5.5,50.5,'01/01/10','5',2010-01-01 00:05:00.100000,2010,1,1
-6,true,6,6,6,60,6.599999904632,60.59999999999999,'01/01/10','6',2010-01-01 00:06:00.150000,2010,1,1
-7,false,7,7,7,70,7.699999809265,70.7,'01/01/10','7',2010-01-01 00:07:00.210000,2010,1,1
-8,true,8,8,8,80,8.800000190734,80.8,'01/01/10','8',2010-01-01 00:08:00.280000,2010,1,1
-9,false,9,9,9,90,9.899999618530,90.89999999999999,'01/01/10','9',2010-01-01 00:09:00.360000,2010,1,1
-10,true,NULL,10,10,100,11,101,'01/01/10','10',2010-01-01 00:10:00.450000,2010,1,1
-11,false,1,11,11,110,12.10000038146,111.1,'01/01/10','11',2010-01-01 00:11:00.550000,2010,1,1
-12,true,2,12,12,120,13.19999980926,121.2,'01/01/10','12',2010-01-01 00:12:00.660000,2010,1,1
-13,false,3,13,13,130,14.30000019073,131.3,'01/01/10','13',2010-01-01 00:13:00.780000,2010,1,1
-14,true,4,14,14,140,15.39999961853,141.4,'01/01/10','14',2010-01-01 00:14:00.910000,2010,1,1
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int, int
====
@@ -1009,27 +966,6 @@ limit 100
83,83,3,3,983,8.800000190734863,'3',1
91,91,1,1,991,6.599999904632568,'1',0
91,91,1,1,991,6.599999904632568,'1',1
----- DBAPI_RESULTS
-31,31,1,1,931,6.599999904632,'1',0
-31,31,1,1,931,6.599999904632,'1',1
-32,32,2,2,932,7.699999809265,'2',0
-32,32,2,2,932,7.699999809265,'2',1
-33,33,3,3,933,8.800000190734,'3',0
-33,33,3,3,933,8.800000190734,'3',1
-41,41,1,1,941,6.599999904632,'1',0
-41,41,1,1,941,6.599999904632,'1',1
-42,42,2,2,942,7.699999809265,'2',0
-42,42,2,2,942,7.699999809265,'2',1
-43,43,3,3,943,8.800000190734,'3',0
-43,43,3,3,943,8.800000190734,'3',1
-81,81,1,1,981,6.599999904632,'1',0
-81,81,1,1,981,6.599999904632,'1',1
-82,82,2,2,982,7.699999809265,'2',0
-82,82,2,2,982,7.699999809265,'2',1
-83,83,3,3,983,8.800000190734,'3',0
-83,83,3,3,983,8.800000190734,'3',1
-91,91,1,1,991,6.599999904632,'1',0
-91,91,1,1,991,6.599999904632,'1',1
---- TYPES
SMALLINT, INT, TINYINT, INT, INT, FLOAT, STRING, INT
====
@@ -1073,10 +1009,6 @@ order by 1 limit 3
0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
1,false,1,1,1,10,1.100000023841858,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
----- DBAPI_RESULTS
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int
====
@@ -1095,10 +1027,6 @@ order by 1,2 limit 3
0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
1,false,1,1,1,10,1.100000023841858,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
----- DBAPI_RESULTS
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int
====
@@ -1118,11 +1046,6 @@ order by 1,2 limit 4
1,false,1,1,1,10,1.100000023841858,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
----- DBAPI_RESULTS
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
-2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int
====
@@ -1149,14 +1072,6 @@ limit 20
2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
3,false,1,1,1,10,1.100000023841858,10.1,'02/01/09','1',2009-02-01 00:01:00,2009,2
4,true,0,0,0,0,0,0,'03/01/09','0',2009-03-01 00:00:00,2009,3
----- DBAPI_RESULTS
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
-3,false,1,1,1,10,1.10000002384158,10.1,'02/01/09','1',2009-02-01 00:01:00,2009,2
-4,true,0,0,0,0,0,0,'03/01/09','0',2009-03-01 00:00:00,2009,3
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int
====
@@ -1181,12 +1096,6 @@ limit 20
2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
3,false,1,1,1,10,1.100000023841858,10.1,'02/01/09','1',2009-02-01 00:01:00,2009,2
4,true,0,0,0,0,0,0,'03/01/09','0',2009-03-01 00:00:00,2009,3
----- DBAPI_RESULTS
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
-3,false,1,1,1,10,1.100000023841,10.1,'02/01/09','1',2009-02-01 00:01:00,2009,2
-4,true,0,0,0,0,0,0,'03/01/09','0',2009-03-01 00:00:00,2009,3
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int
====
@@ -1226,18 +1135,6 @@ limit 20
6,true,0,0,0,0,0,0,'04/01/09','0',2009-04-01 00:00:00,2009,4
7,false,1,1,1,10,1.100000023841858,10.1,'04/01/09','1',2009-04-01 00:01:00,2009,4
7,false,1,1,1,10,1.100000023841858,10.1,'04/01/09','1',2009-04-01 00:01:00,2009,4
----- DBAPI_RESULTS
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
-3,false,1,1,1,10,1.100000023841,10.1,'02/01/09','1',2009-02-01 00:01:00,2009,2
-4,true,0,0,0,0,0,0,'03/01/09','0',2009-03-01 00:00:00,2009,3
-4,true,0,0,0,0,0,0,'03/01/09','0',2009-03-01 00:00:00,2009,3
-5,false,1,1,1,10,1.100000023841,10.1,'03/01/09','1',2009-03-01 00:01:00,2009,3
-6,true,0,0,0,0,0,0,'04/01/09','0',2009-04-01 00:00:00,2009,4
-6,true,0,0,0,0,0,0,'04/01/09','0',2009-04-01 00:00:00,2009,4
-7,false,1,1,1,10,1.100000023841,10.1,'04/01/09','1',2009-04-01 00:01:00,2009,4
-7,false,1,1,1,10,1.100000023841,10.1,'04/01/09','1',2009-04-01 00:01:00,2009,4
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int
====
@@ -1257,12 +1154,6 @@ order by 1 limit 5
1,false,1,1,1,10,1.100000023841858,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
1,false,1,1,1,10,1.100000023841858,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
----- DBAPI_RESULTS
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int
====
@@ -1280,10 +1171,6 @@ order by 1 limit 3
0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
1,false,1,1,1,10,1.100000023841858,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
----- DBAPI_RESULTS
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
---- TYPES
int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int
====
@@ -1359,15 +1246,6 @@ select * from functional.alltypestiny order by 2,1 limit 10
2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
4,true,0,0,0,0,0,0,'03/01/09','0',2009-03-01 00:00:00,2009,3
6,true,0,0,0,0,0,0,'04/01/09','0',2009-04-01 00:00:00,2009,4
----- DBAPI_RESULTS
-1,false,1,1,1,10,1.100000023841,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
-3,false,1,1,1,10,1.100000023841,10.1,'02/01/09','1',2009-02-01 00:01:00,2009,2
-5,false,1,1,1,10,1.100000023841,10.1,'03/01/09','1',2009-03-01 00:01:00,2009,3
-7,false,1,1,1,10,1.100000023841,10.1,'04/01/09','1',2009-04-01 00:01:00,2009,4
-0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
-2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
-4,true,0,0,0,0,0,0,'03/01/09','0',2009-03-01 00:00:00,2009,3
-6,true,0,0,0,0,0,0,'04/01/09','0',2009-04-01 00:00:00,2009,4
---- TYPES
INT, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, STRING, STRING, TIMESTAMP, INT, INT
====
diff --git a/tests/common/impala_connection.py b/tests/common/impala_connection.py
index 0fee7d9..f51a85e 100644
--- a/tests/common/impala_connection.py
+++ b/tests/common/impala_connection.py
@@ -298,7 +298,7 @@ class ImpylaHS2Connection(ImpalaConnection):
use_http_transport=self.__use_http_transport,
http_path=self.__http_path, **conn_kwargs)
# Get the default query options for the session before any modifications are made.
- self.__cursor = self.__impyla_conn.cursor()
+ self.__cursor = self.__impyla_conn.cursor(convert_types=False)
self.__default_query_options = {}
if not self._is_hive:
self.__cursor.execute("set all")
@@ -473,14 +473,16 @@ class ImpylaHS2ResultSet(object):
def __convert_result_row(self, result_tuple):
"""Take primitive values from a result tuple and construct the tab-separated string
that would have been returned via beeswax."""
- return '\t'.join([self.__convert_result_value(val, type)
- for val, type in zip(result_tuple, self.column_types)])
+ return '\t'.join([self.__convert_result_value(val) for val in result_tuple])
- def __convert_result_value(self, val, type):
+ def __convert_result_value(self, val):
"""Take a primitive value from a result tuple and its type and construct the string
that would have been returned via beeswax."""
if val is None:
return 'NULL'
+ if type(val) == float:
+ # Same format as what Beeswax uses in the backend.
+ return "{:.16g}".format(val)
else:
return str(val)
diff --git a/tests/common/impala_test_suite.py b/tests/common/impala_test_suite.py
index 039485c..7978f91 100644
--- a/tests/common/impala_test_suite.py
+++ b/tests/common/impala_test_suite.py
@@ -494,7 +494,7 @@ class ImpalaTestSuite(BaseTestSuite):
actual values are easily compared.
"""
replace_filenames_with_placeholder = True
- for section_name in ('RESULTS', 'DBAPI_RESULTS', 'ERRORS'):
+ for section_name in ('RESULTS', 'ERRORS'):
if section_name in test_section:
if "$NAMENODE" in test_section[section_name]:
replace_filenames_with_placeholder = False
@@ -515,12 +515,6 @@ class ImpalaTestSuite(BaseTestSuite):
result_section, type_section = 'RESULTS', 'TYPES'
if vector.get_value('protocol').startswith('hs2'):
# hs2 or hs2-http
- if 'DBAPI_RESULTS' in test_section:
- assert 'RESULTS' in test_section,\
- "Base RESULTS section must always be included alongside DBAPI_RESULTS"
- # In some cases Impyla (the HS2 dbapi client) is expected to return different
- # results, so use the dbapi-specific section if present.
- result_section = 'DBAPI_RESULTS'
if 'HS2_TYPES' in test_section:
assert 'TYPES' in test_section,\
"Base TYPES section must always be included alongside HS2_TYPES"
diff --git a/tests/util/test_file_parser.py b/tests/util/test_file_parser.py
index b4d4a17..135a024 100644
--- a/tests/util/test_file_parser.py
+++ b/tests/util/test_file_parser.py
@@ -96,7 +96,7 @@ def parse_query_test_file(file_name, valid_section_names=None, encoding=None):
if section_names is None:
section_names = ['QUERY', 'HIVE_QUERY', 'RESULTS', 'TYPES', 'LABELS', 'SETUP',
'CATCH', 'ERRORS', 'USER', 'RUNTIME_PROFILE', 'SHELL', 'DML_RESULTS',
- 'DBAPI_RESULTS', 'HS2_TYPES', 'HIVE_MAJOR_VERSION', 'LINEAGE']
+ 'HS2_TYPES', 'HIVE_MAJOR_VERSION', 'LINEAGE']
return parse_test_file(file_name, section_names, encoding=encoding,
skip_unknown_sections=False)