shrirangmhalgi commented on code in PR #56505:
URL: https://github.com/apache/spark/pull/56505#discussion_r3425894251


##########
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:
   The early return here disables ALL variant pushdown when the scan doesn't 
support deferral - including non-strict accesses (`try_variant_get`, plain 
variant reads) that don't need companion support. Could we limit this to plans 
that actually contain strict-cast extractions? Non-strict pushdowns are 
independently safe.
   
   



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