From 603153c36c2b23f0e4db31f43de7cc103565395e Mon Sep 17 00:00:00 2001 From: Colin Dellow Date: Sat, 23 Jun 2018 20:42:38 -0400 Subject: [PATCH] avoid looking up physical type --- parquet/parquet_cursor.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/parquet/parquet_cursor.cc b/parquet/parquet_cursor.cc index ee2ad6f..2468a58 100644 --- a/parquet/parquet_cursor.cc +++ b/parquet/parquet_cursor.cc @@ -666,17 +666,19 @@ bool ParquetCursor::currentRowSatisfiesFilter() { } else if(op == IsNotNull) { rv = !isNull(column); } else { - parquet::Type::type pqType = types[column]; - if(pqType == parquet::Type::BYTE_ARRAY && logicalTypes[column] == parquet::LogicalType::UTF8) { + if(logicalTypes[column] == parquet::LogicalType::UTF8) { rv = currentRowSatisfiesTextFilter(constraints[i]); - } else if(pqType == parquet::Type::INT32 || - pqType == parquet::Type::INT64 || - pqType == parquet::Type::INT96 || - pqType == parquet::Type::BOOLEAN) { - rv = currentRowSatisfiesIntegerFilter(constraints[i]); - } else if(pqType == parquet::Type::FLOAT || pqType == parquet::Type::DOUBLE) { - rv = currentRowSatisfiesDoubleFilter(constraints[i]); + } else { + parquet::Type::type pqType = types[column]; + if(pqType == parquet::Type::INT32 || + pqType == parquet::Type::INT64 || + pqType == parquet::Type::INT96 || + pqType == parquet::Type::BOOLEAN) { + rv = currentRowSatisfiesIntegerFilter(constraints[i]); + } else if(pqType == parquet::Type::FLOAT || pqType == parquet::Type::DOUBLE) { + rv = currentRowSatisfiesDoubleFilter(constraints[i]); + } } }