Repository: incubator-impala Updated Branches: refs/heads/master 2b5d1344c -> acb25a6d1
IMPALA-4237: Fix materialization of 4 byte decimals in data source scan node. There was a missing break in a switch statement leading to bad fallthrough. An existing test already expected incorrect results. The bug is covered by expecting correct results. Change-Id: I5340c2eda813afc032ba72203bd59eb3f2c4f482 Reviewed-on: http://gerrit.cloudera.org:8080/4585 Reviewed-by: Alex Behm <[email protected]> Tested-by: Internal Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/d9dc9090 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/d9dc9090 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/d9dc9090 Branch: refs/heads/master Commit: d9dc9090ea45220dc07dda3e171574828c1c0828 Parents: 2b5d134 Author: Alex Behm <[email protected]> Authored: Fri Sep 30 21:47:24 2016 -0700 Committer: Internal Jenkins <[email protected]> Committed: Fri Oct 7 03:36:43 2016 +0000 ---------------------------------------------------------------------- be/src/exec/data-source-scan-node.cc | 1 + .../queries/QueryTest/data-source-tables.test | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/d9dc9090/be/src/exec/data-source-scan-node.cc ---------------------------------------------------------------------- diff --git a/be/src/exec/data-source-scan-node.cc b/be/src/exec/data-source-scan-node.cc index a15f03f..0faae94 100644 --- a/be/src/exec/data-source-scan-node.cc +++ b/be/src/exec/data-source-scan-node.cc @@ -175,6 +175,7 @@ inline Status SetDecimalVal(const ColumnType& type, char* bytes, int len, ParquetPlainEncoder::Decode(buffer, buffer + len, len, val) < 0)) { return Status(ERROR_INVALID_DECIMAL); } + break; } case 8: { Decimal8Value* val = reinterpret_cast<Decimal8Value*>(slot); http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/d9dc9090/testdata/workloads/functional-query/queries/QueryTest/data-source-tables.test ---------------------------------------------------------------------- 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 c12968d..19868be 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/data-source-tables.test +++ b/testdata/workloads/functional-query/queries/QueryTest/data-source-tables.test @@ -8,11 +8,11 @@ from alltypes_datasource where float_col != 0 and int_col >= 1990 limit 5 ---- RESULTS -1990,true,0,90,1990,4294967295,2189,1990,1970-01-01 00:00:01.990000000,'NULL',-999998009,-9999998009,-9999999999.9999998009,-9.9999999999999999999999999999999998009,-99999.98009 -1991,false,1,91,1991,0,2190.10009765625,1991,1970-01-01 00:00:01.991000000,'1991',999998008,9999998008,9999999999.9999998008,9.9999999999999999999999999999999998008,99999.98008 -1992,true,2,92,1992,4294967295,2191.199951171875,1992,1970-01-01 00:00:01.992000000,'1992',-999998007,-9999998007,-9999999999.9999998007,-9.9999999999999999999999999999999998007,-99999.98007 -1993,false,3,93,1993,0,2192.300048828125,1993,1970-01-01 00:00:01.993000000,'1993',999998006,9999998006,9999999999.9999998006,9.9999999999999999999999999999999998006,99999.98006 -1994,true,4,94,1994,4294967295,2193.39990234375,1994,1970-01-01 00:00:01.994000000,'1994',-999998005,-9999998005,-9999999999.9999998005,-9.9999999999999999999999999999999998005,-99999.98005 +1990,true,0,90,1990,19900,2189,1990,1970-01-01 00:00:01.990000000,'NULL',-999998009,-9999998009,-9999999999.9999998009,-9.9999999999999999999999999999999998009,-99999.98009 +1991,false,1,91,1991,19910,2190.10009765625,1991,1970-01-01 00:00:01.991000000,'1991',999998008,9999998008,9999999999.9999998008,9.9999999999999999999999999999999998008,99999.98008 +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 +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 +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 ---- TYPES INT, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, TIMESTAMP, STRING, DECIMAL, DECIMAL, DECIMAL, DECIMAL, DECIMAL ====
