rui-mo commented on code in PR #5954:
URL: https://github.com/apache/incubator-gluten/pull/5954#discussion_r1706614510


##########
cpp/velox/substrait/SubstraitToVeloxPlan.cc:
##########
@@ -1712,19 +1733,6 @@ void SubstraitToVeloxPlanConverter::separateFilters(
   for (const auto& scalarFunction : scalarFunctions) {
     auto filterNameSpec = SubstraitParser::findFunctionSpec(functionMap_, 
scalarFunction.function_reference());
     auto filterName = SubstraitParser::getNameBeforeDelimiter(filterNameSpec);
-    // Add all decimal filters to remaining functions because their pushdown 
are not supported.
-    if (format == dwio::common::FileFormat::ORC && 
scalarFunction.arguments().size() > 0) {

Review Comment:
   Looks like previous logic only excludes decimal type for ORC format, but now 
we are excluding HUGEINT for all file formats. Could you confirm if it is 
expected?



##########
cpp/velox/substrait/SubstraitToVeloxPlan.cc:
##########
@@ -1600,17 +1600,26 @@ bool 
SubstraitToVeloxPlanConverter::childrenFunctionsOnSameField(
 bool SubstraitToVeloxPlanConverter::canPushdownFunction(
     const ::substrait::Expression_ScalarFunction& scalarFunction,
     const std::string& filterName,
-    uint32_t& fieldIdx) {
-  // Condtions can be pushed down.
+    uint32_t& fieldIdx,
+    const std::vector<TypePtr>& veloxTypeList) {
+  // Conditions can be pushed down.
   static const std::unordered_set<std::string> supportedFunctions = 
{sIsNotNull, sIsNull, sGte, sGt, sLte, sLt, sEqual};
 
-  bool canPushdown = false;
-  if (supportedFunctions.find(filterName) != supportedFunctions.end() &&
-      fieldOrWithLiteral(scalarFunction.arguments(), fieldIdx)) {
-    // The arg should be field or field with literal.
-    canPushdown = true;
+  if (supportedFunctions.find(filterName) == supportedFunctions.end()) {
+    return false;
+  }
+
+  // The arg should be field or field with literal.
+  if (!fieldOrWithLiteral(scalarFunction.arguments(), fieldIdx)) {
+    return false;
   }
-  return canPushdown;
+
+  // check whether data type is supported or not

Review Comment:
   nit: capitalize the first letter and add `.` at the end for comments.



-- 
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