Copilot commented on code in PR #12873:
URL: https://github.com/apache/gluten/pull/12873#discussion_r4072634620


##########
backends-velox/src/main/scala/org/apache/gluten/expression/ExpressionRestrictions.scala:
##########
@@ -83,6 +83,44 @@ object Unbase64Restrictions extends ExpressionRestrictions {
   override val restrictionMessages: Array[String] = 
Array(NOT_SUPPORT_FAIL_ON_ERROR)
 }
 
+object EltRestrictions extends ExpressionRestrictions {
+  val NOT_SUPPORT_FAIL_ON_ERROR_MISMATCH: String =
+    s"${ExpressionNames.ELT} whose failOnError disagrees with the session's " +
+      s"'${SQLConf.ANSI_ENABLED.key}' is not supported, since Velox derives 
the ANSI " +
+      s"behavior of elt from the session config"
+
+  override val functionName: String = ExpressionNames.ELT
+
+  override val restrictionMessages: Array[String] = 
Array(NOT_SUPPORT_FAIL_ON_ERROR_MISMATCH)
+}
+
+object ConvRestrictions extends ExpressionRestrictions {
+  val NOT_SUPPORT_ANSI_ENABLED_MISMATCH: String =
+    s"${ExpressionNames.CONV} whose ansiEnabled disagrees with the session's " 
+
+      s"'${SQLConf.ANSI_ENABLED.key}' is not supported, since Velox derives 
the ANSI " +
+      s"behavior of conv from the session config"
+
+  override val functionName: String = ExpressionNames.CONV
+
+  override val restrictionMessages: Array[String] = 
Array(NOT_SUPPORT_ANSI_ENABLED_MISMATCH)
+}
+
+object ElementAtRestrictions extends ExpressionRestrictions {
+  val NOT_SUPPORT_FAIL_ON_ERROR_MISMATCH: String =
+    s"${ExpressionNames.ELEMENT_AT} over an array whose failOnError disagrees 
with the " +
+      s"session's '${SQLConf.ANSI_ENABLED.key}' is not supported, since Velox 
derives the " +
+      s"ANSI behavior of element_at from the session config"
+
+  val NOT_SUPPORT_DEFAULT_VALUE_OUT_OF_BOUND: String =
+    s"${ExpressionNames.ELEMENT_AT} with a default value for an out-of-bound 
index is not " +
+      s"supported in Velox, which always returns NULL for such an index"

Review Comment:
   The restriction message is now inaccurate: with this PR, Velox overlay 
`element_at` may raise an error for out-of-bound array indices when ANSI is 
enabled, so it does not 'always return NULL'. Reword the message to focus on 
the real limitation (default value for out-of-bound is unsupported) without 
asserting a specific out-of-bound behavior (e.g., 'Velox element_at does not 
support a default value for out-of-bound indexes').



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