From 373616ad1ed93073937a5d0b66084ae799eea7d4 Mon Sep 17 00:00:00 2001 From: Colin Dellow Date: Wed, 4 Jul 2018 18:59:16 -0400 Subject: [PATCH] Don't try to optimize IsNot Doesn't handle NULLs correctly, will open separate ticket for it. Fixes the IS NOT case of #26 --- parquet/parquet_cursor.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/parquet/parquet_cursor.cc b/parquet/parquet_cursor.cc index 4a93b5b..550d980 100644 --- a/parquet/parquet_cursor.cc +++ b/parquet/parquet_cursor.cc @@ -124,7 +124,6 @@ bool ParquetCursor::currentRowGroupSatisfiesBlobFilter(Constraint& constraint, s &blob[0], &blob[0] + blob.size()); } - case IsNot: case NotEqual: { // If min == max == blob, we can skip this. @@ -132,6 +131,7 @@ bool ParquetCursor::currentRowGroupSatisfiesBlobFilter(Constraint& constraint, s bool minMaxEqual = minLen == maxLen && memcmp(minPtr, maxPtr, minLen) == 0; return !(blobMaxEqual && minMaxEqual); } + case IsNot: default: return true; } @@ -168,7 +168,6 @@ bool ParquetCursor::currentRowGroupSatisfiesTextFilter(Constraint& constraint, s return minStr < str; case LessThanOrEqual: return minStr <= str; - case IsNot: case NotEqual: // If min == max == str, we can skip this. return !(minStr == maxStr && str == minStr); @@ -179,6 +178,7 @@ bool ParquetCursor::currentRowGroupSatisfiesTextFilter(Constraint& constraint, s std::string truncatedMax = maxStr.substr(0, likeStringValue.size()); return likeStringValue.empty() || (likeStringValue >= truncatedMin && likeStringValue <= truncatedMax); } + case IsNot: default: return true; } @@ -260,11 +260,11 @@ bool ParquetCursor::currentRowGroupSatisfiesIntegerFilter(Constraint& constraint return min < value; case LessThanOrEqual: return min <= value; - case IsNot: case NotEqual: // If min == max == str, we can skip this. return !(min == max && value == min); case Like: + case IsNot: default: return true; } @@ -323,11 +323,11 @@ bool ParquetCursor::currentRowGroupSatisfiesDoubleFilter(Constraint& constraint, return min < value; case LessThanOrEqual: return min <= value; - case IsNot: case NotEqual: // If min == max == str, we can skip this. return !(min == max && value == min); case Like: + case IsNot: default: return true; } @@ -354,7 +354,6 @@ bool ParquetCursor::currentRowSatisfiesTextFilter(Constraint& constraint) { return 0 == memcmp(&blob[0], ba->ptr, ba->len); } - case IsNot: case NotEqual: { const std::vector& blob = constraint.blobValue; @@ -419,6 +418,7 @@ bool ParquetCursor::currentRowSatisfiesTextFilter(Constraint& constraint) { len = likeStringValue.size(); return 0 == memcmp(&likeStringValue[0], ba->ptr, len); } + case IsNot: default: return true; } @@ -458,7 +458,6 @@ bool ParquetCursor::currentRowSatisfiesIntegerFilter(Constraint& constraint) { case Is: case Equal: return constraintValue == value; - case IsNot: case NotEqual: return constraintValue != value; case GreaterThan: @@ -470,6 +469,7 @@ bool ParquetCursor::currentRowSatisfiesIntegerFilter(Constraint& constraint) { case LessThanOrEqual: return value <= constraintValue; case Like: + case IsNot: default: return true; } @@ -490,7 +490,6 @@ bool ParquetCursor::currentRowSatisfiesDoubleFilter(Constraint& constraint) { case Is: case Equal: return constraintValue == value; - case IsNot: case NotEqual: return constraintValue != value; case GreaterThan: @@ -502,6 +501,7 @@ bool ParquetCursor::currentRowSatisfiesDoubleFilter(Constraint& constraint) { case LessThanOrEqual: return value <= constraintValue; case Like: + case IsNot: default: return true; }