chenhao-db commented on code in PR #56505:
URL: https://github.com/apache/spark/pull/56505#discussion_r3431287091


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanRelationPushDown.scala:
##########
@@ -427,6 +427,10 @@ object V2ScanRelationPushDown extends Rule[LogicalPlan] 
with PredicateHelper {
     // If no variant columns remain after collection, return original plan
     if (variants.mapping.forall(_._2.isEmpty)) return originalPlan
 
+    // Cast-error deferral needs reader support for synthetic companion 
fields. If a scan only
+    // supports plain variant extraction pushdown, leave the plan untouched 
while deferral is on.
+    if (variants.deferCastErrorEnabled && !builder.supportsDeferCastError()) 
return originalPlan

Review Comment:
   Done. Now I check `builder.supportsDeferCastError()` after we know there is 
at least a companion field.



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