rdtr opened a new issue, #13609: URL: https://github.com/apache/gluten/issues/13609
### Description ### Description Spark returns the saturated value for `ceil` / `floor` of a double outside the BIGINT range in both ANSI modes up to Spark 4.2 (`SELECT ceil(1e20D)` returns 9223372036854775807). Since Spark 4.3 (SPARK-58052), `Ceil` and `Floor` carry `failOnError` and throw `ARITHMETIC_OVERFLOW` with ANSI on. Velox's Spark `ceil` / `floor` read `spark.ansi_enabled` from the query config and throw with ANSI on since facebookincubator/velox#20058 (merged as e87e0ea70). The pinned Velox `dft-2026_11_06` doesn't have it yet. The next bump brings it. #13529 handles the gap by counting a double `Ceil` / `Floor` as ANSI off before Spark 4.3. In an ANSI-on session with `spark.gluten.sql.ansiFallback.enabled=false`, the project falls back to Spark, even for values that never overflow. ### Remaining work - [ ] Spark 4.3: read `failOnError` from `Ceil` / `Floor` and keep them native when it matches the session. `AnsiModeMismatch` already reads it by reflection. What is left are Spark 4.3 tests for ANSI on, ANSI off and a view mismatch, once the Spark 4.3 shim (#13519) and a Velox pin with facebookincubator/velox#20058 are in. - [ ] Before Spark 4.3: keep them native with ANSI on. This needs a Velox form that saturates regardless of `spark.ansi_enabled` (for example a separate function name that Gluten picks for Spark < 4.3). Related: #13528, #13529 ### Gluten version main branch -- 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]
