rui-mo commented on code in PR #13282:
URL: https://github.com/apache/gluten/pull/13282#discussion_r4620317989


##########
backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxValidatorApi.scala:
##########
@@ -39,17 +40,36 @@ import io.substrait.proto.SimpleExtensionDeclaration
 import scala.collection.JavaConverters._
 import scala.collection.mutable.ArrayBuffer
 
-class VeloxValidatorApi extends ValidatorApi {
+class VeloxValidatorApi extends ValidatorApi with Logging {
   import VeloxValidatorApi._
 
-  /** For velox backend, key validation is on native side. */
-  override def doExprValidate(substraitExprName: String, expr: Expression): 
Boolean = {
-    expr match {
-      // Both format_string and printf resolve to Spark's FormatString 
expression.
-      case formatString: FormatString =>
-        supportsFormatString(formatString)
-      case _ => true
-    }
+  /**
+   * Enforce integral ROUND eligibility on the JVM to preserve Spark's 
captured ANSI semantics,
+   * independently of optional native plan validation.
+   */
+  override def doExprValidate(substraitExprName: String, expr: Expression): 
Boolean = expr match {
+    // Both format_string and printf resolve to Spark's FormatString 
expression.
+    case formatString: FormatString =>
+      supportsFormatString(formatString)
+    case round: Round =>

Review Comment:
   Can we move the validation to native validator?



##########
docs/backends/velox/velox-backend-scalar-function-support.md:
##########
@@ -297,7 +297,7 @@ The status applies to `spark.sql.ansi.enabled=false`. When 
ANSI mode is enabled,
 | randn             | Randn                  | S        |                |
 | random            | Rand                   | S        |                |
 | rint              | Rint                   | S        |                |
-| round             | Round                  | S        |                |
+| round             | Round                  | PS       | Integral inputs use 
Velox for INTEGER literal scales in [0, 400] or NULL; otherwise Spark fallback. 
NULL skips child evaluation. |

Review Comment:
   We could skip updating the support status in each PR because this document 
can be updated in bunch.



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