urosstan-db commented on code in PR #52940:
URL: https://github.com/apache/spark/pull/52940#discussion_r2511391986


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/V2ExpressionBuilder.scala:
##########
@@ -326,6 +326,9 @@ class V2ExpressionBuilder(e: Expression, isPredicate: 
Boolean = false) extends L
     case _: Sha2 => generateExpressionWithName("SHA2", expr, isPredicate)
     case _: StringLPad => generateExpressionWithName("LPAD", expr, isPredicate)
     case _: StringRPad => generateExpressionWithName("RPAD", expr, isPredicate)
+    case GetArrayItem(_, _, failOnError) if failOnError =>
+      // Pushdown only if ANSI is enabled (fail on error) to be compatible 
with remote systems.
+      generateExpressionWithName("GET_ARRAY_ITEM", expr, isPredicate)

Review Comment:
   We can make new v2 expression as well to be able to pass `failOnError` 
argument, since `get` method in spark returns 0-indexed element of array, but 
it does not fail for index out of bounds, so it would be beneficial to pass 
`failOnError` to be able to support `get` method pushdown beside bracket 
access. WDYT @srielau @cloud-fan  ?



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