compiler-segfault commented on PR #66:
URL: https://github.com/apache/datafusion-spark/pull/66#issuecomment-6876980406
All four handled in a9378386, rebased onto current `main` (so the new README
Quick start sections are kept):
1. **Decimal divided by float/double.** The planner now keeps `/` only for
DECIMAL / DECIMAL and DECIMAL / integral; a floating point operand on either
side coerces to DOUBLE. Added
`CAST(1 AS DECIMAL(10,2)) / CAST(2 AS DOUBLE)` → `Float64 0.5` and
`CAST(1 AS DECIMAL(10,2)) / CAST(0 AS DOUBLE)` → `Float64 NULL` to `divide.slt`.
2. **`5 / 2.0`.** The test now uses `SELECT 5 / CAST(2 AS DOUBLE)`. In
DataFusion `2.0` parses as a `Float64` literal rather than `DECIMAL(2,1)`
(`arrow_typeof(2.0)` returns `Float64`), so Spark's decimal-literal case cannot
be spelled from SQL; the explicit cast is the doable version.
3. **Comment.** It now says DataFusion's `/` derives the same precision and
scale for the DECIMAL cases, but that other decimal behaviour still differs
(e.g. DECIMAL / 0 in non-ANSI mode returns an error instead of NULL) and is
tracked separately.
4. **READMEs.** Both now mention `features = ["core", "sql"]` and what `sql`
adds (`/` cast to DOUBLE and NULL on a zero divisor).
Verification on this head: `cargo test -p datafusion-spark` passes, `cargo
test -p datafusion-spark-sqllogictest` is 246/246 files, `cargo clippy
--all-targets --all-features -- -D warnings` is clean, `cargo fmt --all` is
clean.
--
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]