acvictor commented on code in PR #11711:
URL: 
https://github.com/apache/incubator-gluten/pull/11711#discussion_r2904358392


##########
cpp/velox/operators/functions/SparkExprToSubfieldFilterParser.cc:
##########
@@ -16,11 +16,64 @@
  */
 #include "operators/functions/SparkExprToSubfieldFilterParser.h"
 
+#include "velox/common/base/BloomFilter.h"
+#include "velox/expression/Expr.h"
+#include "velox/vector/ComplexVector.h"
+
 namespace gluten {
 
 using namespace facebook::velox;
 
 namespace {
+
+VectorPtr toConstant(const core::TypedExprPtr& expr, 
core::ExpressionEvaluator* evaluator) {
+  auto exprSet = evaluator->compile(expr);
+  if (!exprSet->exprs()[0]->isConstantExpr()) {
+    return nullptr;
+  }
+  RowVector input(evaluator->pool(), ROW({}, {}), nullptr, 1, 
std::vector<VectorPtr>{});
+  SelectivityVector rows(1);
+  VectorPtr result;
+  try {
+    evaluator->evaluate(exprSet.get(), rows, input, result);
+  } catch (const VeloxUserError&) {
+    return nullptr;
+  }

Review Comment:
   Errors are intentionally swallowed because a non-evaluable expression simply 
means the filter cannot be pushed down. So if the filter cannot be pushed down, 
`leafCallToSubfieldFilter` returns `std::nullopt`, and Velox will evaluate 
`might_contain` as a regular post-scan expression which is the same behavior as 
before. Does this flow make sense? I have updated the comment as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to