alamb commented on code in PR #11400:
URL: https://github.com/apache/datafusion/pull/11400#discussion_r1672854921


##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -62,7 +64,27 @@ impl BinaryExpr {
         op: Operator,
         right: Arc<dyn PhysicalExpr>,
     ) -> Self {
-        Self { left, op, right }
+        Self {
+            left,
+            op,
+            right,
+            fail_on_overflow: false,
+        }
+    }
+
+    /// Create new binary expression with explicit fail_on_overflow value

Review Comment:
   Another alternative API might be more of a builder style and easier to 
extend in the fuuure
   
   ```rust
           // create expression
           let expr = BinaryExpr::new(
               Arc::new(Column::new("l", 0)),
               Operator::Plus,
               Arc::new(Column::new("r", 1)),
            )
             // configure to fail on overflow
             .with_fail_on_overflow(true);
   ```



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