Abhinav-Agarwal021 commented on PR #13639: URL: https://github.com/apache/gluten/pull/13639#issuecomment-7004878465
Thanks @rui-mo, I agree. Message matching works for a single fixed message, but it can't reliably pick the Spark error class or fill its parameters. For example, Velox's `Arithmetic overflow: a + b` doesn't say `integer` vs `long`, and `division by zero` is used for both `DIVIDE_BY_ZERO` and `REMAINDER_BY_ZERO`. A Velox rewording would also break the mapping without failing any Gluten test. I've opened a design proposal for the runtime side: #13685. A matching Velox issue will follow for the Velox-side changes. In short: - **Contract:** Velox Spark functions (`velox/functions/sparksql`) raise errors with a Spark `(condition, params)` pair, using names from Spark's `error-conditions.json`. Shared Presto/Spark helpers don't name Spark classes, so Presto doesn't change. - **Translation on the executor:** Gluten's `translateException` turns the pair into the real Spark exception through a per-Spark-version shim that calls Spark's own `QueryExecutionErrors` factories. On Spark 4.x, `DAGScheduler` then passes it to the user unwrapped (SPARK-46922) instead of `Job aborted due to stage failure`. Anything it can't translate falls back to today's `GlutenException`. - **Transport:** start with a structured marker in the Velox reason (no core Velox or JNI change, and nothing extra on the success path or inside `TRY`). The same contract lets us move to a typed Velox exception later without touching raise sites or shims. - **Scope:** about 30 Spark error classes in phases, starting with ANSI arithmetic. This PR's `EXCEED_LIMIT_LENGTH` and #13135's cast classes fit directly into it. It also covers the open questions, including whether PRs like this one should land now and migrate later. Feedback welcome there. cc @pedrumj2 @philo-he @zhztheplayer -- 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]
