From 8bf890ab660c5b6a347eb61d1dccf9400c005c40 Mon Sep 17 00:00:00 2001 From: Colin Dellow Date: Sun, 18 Mar 2018 19:43:09 -0400 Subject: [PATCH] Fix incorrect row pruning for non-text BYTE_ARRAY --- parquet/parquet_cursor.cc | 2 +- tests/templates/139-random-testcase.sql | 37 +++++++++++++++++++++++++ tests/test-random | 2 +- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 tests/templates/139-random-testcase.sql diff --git a/parquet/parquet_cursor.cc b/parquet/parquet_cursor.cc index 8a4b250..d66a992 100644 --- a/parquet/parquet_cursor.cc +++ b/parquet/parquet_cursor.cc @@ -638,7 +638,7 @@ bool ParquetCursor::currentRowSatisfiesFilter() { } else { parquet::Type::type pqType = types[column]; - if(pqType == parquet::Type::BYTE_ARRAY) { + if(pqType == parquet::Type::BYTE_ARRAY && logicalTypes[column] == parquet::LogicalType::UTF8) { rv = currentRowSatisfiesTextFilter(constraints[i]); } else if(pqType == parquet::Type::INT32 || pqType == parquet::Type::INT64 || diff --git a/tests/templates/139-random-testcase.sql b/tests/templates/139-random-testcase.sql new file mode 100644 index 0000000..eb8d1e0 --- /dev/null +++ b/tests/templates/139-random-testcase.sql @@ -0,0 +1,37 @@ +select rowid from nulls1 where binary_9 >= '56' and ts_5 < 496886400000; +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +21 +23 +25 +27 +29 +31 +33 +35 +37 +39 +41 +43 +45 +47 +49 +51 +53 +55 +57 +59 +61 +63 +65 +67 +69 +71 diff --git a/tests/test-random b/tests/test-random index 8862615..7907f15 100755 --- a/tests/test-random +++ b/tests/test-random @@ -80,7 +80,7 @@ def test_table(conn, table): for name in column_names: column_values[name] = get_column_values(conn, table, name) - random.seed(0) + #random.seed(0) all_values = [] for values in column_values.values(): all_values = all_values + values