This is an automated email from the ASF dual-hosted git repository.
changchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
The following commit(s) were added to refs/heads/main by this push:
new 98c6c9a2d6 [GLUTEN-7713][CH] Fix page index reader failed with or
logical operator (#7716)
98c6c9a2d6 is described below
commit 98c6c9a2d68534468be875abb523a477d647d8dc
Author: Chang chen <[email protected]>
AuthorDate: Tue Oct 29 20:24:35 2024 +0800
[GLUTEN-7713][CH] Fix page index reader failed with or logical operator
(#7716)
---
.../execution/parquet/GlutenParquetColumnIndexSuite.scala | 14 +++++++++++++-
cpp-ch/local-engine/Storages/Parquet/ColumnIndexFilter.cpp | 8 +++++---
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git
a/backends-clickhouse/src/test/scala/org/apache/gluten/execution/parquet/GlutenParquetColumnIndexSuite.scala
b/backends-clickhouse/src/test/scala/org/apache/gluten/execution/parquet/GlutenParquetColumnIndexSuite.scala
index 01d01d3e85..f4b217ec50 100644
---
a/backends-clickhouse/src/test/scala/org/apache/gluten/execution/parquet/GlutenParquetColumnIndexSuite.scala
+++
b/backends-clickhouse/src/test/scala/org/apache/gluten/execution/parquet/GlutenParquetColumnIndexSuite.scala
@@ -71,7 +71,19 @@ class GlutenParquetColumnIndexSuite
45,
Some("push down Decimal filter In")
),
- ParquetData("count(*)", "index/pageindex/query05", "`142` = true", 9896)
+ ParquetData("count(*)", "index/pageindex/query05", "`142` = true", 9896),
+ ParquetData(
+ "count(*)",
+ "index/pageindex/query05",
+ "(`145` like '%GTC' and `142` = true) or (not `175` in (23,16,14,100))",
+ 9896,
+ Some("endwith")),
+ ParquetData(
+ "count(*)",
+ "index/pageindex/query05",
+ "(`145` not like 'GTC%' and `154` not in(11,16,14,-99)) or `154` > 3365",
+ 9896,
+ Some("not endwith"))
)
parquetData.foreach {
diff --git a/cpp-ch/local-engine/Storages/Parquet/ColumnIndexFilter.cpp
b/cpp-ch/local-engine/Storages/Parquet/ColumnIndexFilter.cpp
index 52eb7a4f0d..19b68f1456 100644
--- a/cpp-ch/local-engine/Storages/Parquet/ColumnIndexFilter.cpp
+++ b/cpp-ch/local-engine/Storages/Parquet/ColumnIndexFilter.cpp
@@ -958,12 +958,14 @@ RowRanges ColumnIndexFilter::calculateRowRanges(const
ColumnIndexStore & index_s
CALL_OPERATOR(element, [](const ColumnIndex & index, const
RPNElement & e) { return index.in(e.column); });
break;
case RPNElement::FUNCTION_NOT_IN:
+
rpn_stack.emplace_back(RowRanges::createSingle(rowgroup_count));
break;
case RPNElement::FUNCTION_UNKNOWN:
rpn_stack.emplace_back(RowRanges::createSingle(rowgroup_count));
break;
case RPNElement::FUNCTION_NOT:
- assert(false);
+ assert(!rpn_stack.empty());
+ rpn_stack.back() = RowRanges::createSingle(rowgroup_count);
break;
case RPNElement::FUNCTION_AND:
CALL_LOGICAL_OP(RowRanges::intersection);
@@ -972,10 +974,10 @@ RowRanges ColumnIndexFilter::calculateRowRanges(const
ColumnIndexStore & index_s
CALL_LOGICAL_OP(RowRanges::unionRanges);
break;
case RPNElement::ALWAYS_FALSE:
- assert(false);
+ throw DB::Exception(DB::ErrorCodes::LOGICAL_ERROR,
"RPNElement::ALWAYS_FALSE in ColumnIndexFilter::calculateRowRanges");
break;
case RPNElement::ALWAYS_TRUE:
- assert(false);
+ throw DB::Exception(DB::ErrorCodes::LOGICAL_ERROR,
"RPNElement::ALWAYS_TRUE in ColumnIndexFilter::calculateRowRanges");
break;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]