0lai0 opened a new pull request, #5193:
URL: https://github.com/apache/datafusion-comet/pull/5193

   ## Which issue does this PR close?
   
   Part of #5091.
   
   This is the first of a few small PRs splitting up #5091. 
   It covers the two`Int to Decimal128` reinterpretation sites
   the remaining items (`numeric.rs`,`array_insert.rs`, `temporal.rs`, 
`pow.rs`, `covariance.rs`) will follow in separate PRs
   
   ## Rationale for this change
   
   Two sites hand-roll a per-row loop to turn an integer array into a 
`Decimal128` array:
   
   - `native/core/src/execution/columnar_to_row.rs` 
(`maybe_cast_to_schema_type`):
     `Int32`/`Int64 to Decimal128`, via `iter().map().collect()`.
   - `native/spark-expr/src/math_funcs/internal/make_decimal.rs`
     (`spark_make_decimal`): `Int64 → Decimal128`, via a `Decimal128Builder` 
loop.
   
   
   ## What changes are included in this PR?
   
   Replace the hand-rolled per-row loops with arity helpers:
   
   - `columnar_to_row.rs` (`maybe_cast_to_schema_type`): `Int32`/`Int64 → 
Decimal128` via `arity::unary`.
   - `make_decimal.rs` (`spark_make_decimal`): `Int64 → Decimal128` via 
`unary_opt` (non-ANSI, overflow → null) and `try_unary` (ANSI, overflow → 
error).
   
   
   ## How are these changes tested?
   
   - `cargo test -p datafusion-comet-spark-expr` 
   - `cargo test -p datafusion-comet` 


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