talz-a opened a new pull request, #7726:
URL: https://github.com/apache/datafusion-comet/pull/7726

   ## Which issue does this PR close?
   
   Closes #6982.
   
   ## Rationale for this change
   
   As stated in the issue, these four call sites all duplicate code to turn a 
pair of `ColumnarValue`s into `ArrayRef`s. We want to minimize duplicate code 
for potential future changes to how scalar broadcasting works.
   
   ## What changes are included in this PR?
   
   - `checked_arithmetic_internal`, `spark_decimal_div_internal`, 
`checked_float_modulo` and
     `WideDecimalBinaryExpr::evaluate` now call 
`ColumnarValue::values_to_arrays`
     instead of their own match.
   - Unused `ArrayRef` imports are removed.
   - Used `values_to_arrays` rather than adding a `broadcast_pair` helper, 
because it already
     expands two scalars into length-1 arrays (`array_len.unwrap_or(1)`), which 
is what the old
     match did.
   - The one difference: two arrays of different lengths now return an error 
from
     `values_to_arrays` straight away, instead of failing later.
   
   ## How are these changes tested?
   
   No new tests are added, as existing tests cover the behaviour. Tests run 
with the following commands are green:
   
   - `cargo test -p datafusion-comet-spark-expr`
   - `cargo clippy -p datafusion-comet-spark-expr --all-targets -- -D warnings`
   - `cargo fmt --all -- --check`


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