luis4a0 commented on code in PR #13103:
URL: https://github.com/apache/gluten/pull/13103#discussion_r4522640292
##########
backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxValidatorApi.scala:
##########
@@ -38,12 +39,32 @@ 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 =
- true
+ /**
+ * Enforce decimal ROUND scale compatibility on the JVM independently of
optional native plan
+ * validation.
+ */
+ override def doExprValidate(substraitExprName: String, expr: Expression):
Boolean = expr match {
+ case round: Round if round.child.dataType.isInstanceOf[DecimalType] =>
Review Comment:
Yes, this approach makes sense, and the refreshed branch follows it.
Scala keeps the generic Velox validation interface; the decimal
compatibility policy is enforced by native Substrait validation. With native
validation enabled, foldable INTEGER scales in `[-400, 400]` and typed NULL are
accepted, while incompatible/nonliteral scales fall back to Spark. Disabling
native validation intentionally bypasses that policy for debugging, so
unsupported operations may fail at native runtime instead of falling back.
I updated the configuration and function-support documentation to state that
debugging contract. The SQL coverage verifies both normal fallback and
validation-disabled native execution, including a typed-NULL scale that
natively suppresses an overflowing child. New head:
https://github.com/luis4a0/gluten/commit/09cb152e487fc01dcdcd326aa1a59d66e59105a9.
--
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]