zhztheplayer commented on code in PR #10047:
URL: 
https://github.com/apache/incubator-gluten/pull/10047#discussion_r2163566612


##########
gluten-flink/planner/src/main/java/org/apache/gluten/rexnode/functions/BasicCompareOperatorConverters.java:
##########
@@ -59,18 +69,24 @@ public StringNumberCompareRexCallConverter(String 
functionName) {
   }
 
   @Override
-  public boolean isSupported(RexCall callNode, RexConversionContext context) {
+  public ValidationResult doValidate(RexCall callNode, RexConversionContext 
context) {
     // This converter supports string and numeric comparison functions.
     List<Type> paramTypes =
         callNode.getOperands().stream()
             .map(param -> RexNodeConverter.toType(param.getType()))
             .collect(Collectors.toList());
-    if ((TypeUtils.isNumericType(paramTypes.get(0)) && 
TypeUtils.isStringType(paramTypes.get(1)))
-        || (TypeUtils.isStringType(paramTypes.get(0))
-            && TypeUtils.isNumericType(paramTypes.get(1)))) {
-      return true;
+    boolean typesValidate =
+        (TypeUtils.isNumericType(paramTypes.get(0)) && 
TypeUtils.isStringType(paramTypes.get(1)))
+            || (TypeUtils.isStringType(paramTypes.get(0))
+                && TypeUtils.isNumericType(paramTypes.get(1)));
+    if (!typesValidate) {
+      String message =
+          String.format(
+              "String and numeric comparison operation requires one string and 
one numeric operand, but found: %s",
+              getFunctionProtoTypeName(callNode));
+      return ValidationResult.failure(message);

Review Comment:
   Or our case is just more strict than Velox so we have to do our own here?



-- 
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: commits-unsubscr...@gluten.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@gluten.apache.org
For additional commands, e-mail: commits-h...@gluten.apache.org

Reply via email to