kosiew commented on code in PR #21493:
URL: https://github.com/apache/datafusion/pull/21493#discussion_r3061958136


##########
datafusion/physical-expr-adapter/src/schema_rewriter.rs:
##########
@@ -423,13 +422,12 @@ impl DefaultPhysicalExprAdapterRewriter {
             )));
         };
 
-        if resolved_column.index() == column.index()
-            && logical_field == physical_field.as_ref()
-        {
-            return Ok(Transformed::no(expr));
-        }
+        let fields_match = logical_field == physical_field.as_ref();
+        if fields_match {
+            if resolved_column.index() == column.index() {
+                return Ok(Transformed::no(expr));
+            }

Review Comment:
   Yes, that’s right. This part is just a readability refactor: `fields_match` 
avoids repeating the field comparison and groups the “same field” fast path 
together. The behavior should be unchanged here: if both field and index match 
we keep the original expr, and if only the index changed we return the resolved 
column. 
   



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