adriangb commented on code in PR #18736:
URL: https://github.com/apache/datafusion/pull/18736#discussion_r2530154406


##########
datafusion/physical-expr/src/projection.rs:
##########
@@ -625,13 +627,12 @@ impl ProjectionMapping {
                     let idx = col.index();
                     let matching_field = input_schema.field(idx);
                     let matching_name = matching_field.name();
-                    if col.name() != matching_name {
-                        return internal_err!(
-                            "Input field name {} does not match with the 
projection expression {}",
-                            matching_name,
-                            col.name()
-                        );
-                    }
+                    assert_or_internal_err!(
+                        col.name() == matching_name,
+                        "Input field name {} does not match with the 
projection expression {}",
+                        matching_name,
+                        col.name()
+                    );

Review Comment:
   ```suggestion
                       assert_or_internal_err!(
                           col.name() == matching_name,
                           "Input field name {matching_name} does not match 
with the projection expression {}",
                           col.name()
                       );
   ```



##########
datafusion/physical-expr/src/analysis.rs:
##########
@@ -257,9 +255,11 @@ fn shrink_boundaries(
 
     let selectivity = calculate_selectivity(&target_boundaries, 
&initial_boundaries)?;
 
-    if !(0.0..=1.0).contains(&selectivity) {
-        return internal_err!("Selectivity is out of limit: {}", selectivity);
-    }
+    assert_or_internal_err!(
+        (0.0..=1.0).contains(&selectivity),
+        "Selectivity is out of limit: {}",
+        selectivity
+    );

Review Comment:
   ```suggestion
       assert_or_internal_err!(
           (0.0..=1.0).contains(&selectivity),
           "Selectivity is out of limit: {selectivity}",
       );
   ```



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