[VL] Translate Velox bitmap_construct_agg exceptions to Spark-native exception types
- Dominant language
- Scala
- Stars
- 1.6k
- Forks
- 657
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 85
Description
## Background
When `bitmap_construct_agg` is offloaded to native Velox execution, invalid bitmap positions throw a `GlutenException` (wrapping `VeloxUserError`) instead of the expected `SparkArrayIndexOutOfBoundsException` with error condition `INVALID_BITMAP_POSITION`.
## Current State
In PR #12142, we excluded the following error-path tests from `VeloxTestSettings` as a workaround:
- `INVALID_BITMAP_POSITION: position out of bounds`
- `INVALID_BITMAP_POSITION: negative position`
These tests verify that Spark throws `SparkArrayIndexOutOfBoundsException` for out-of-bounds and negative positions in `bitmap_construct_agg`. Since Velox produces its own error format (`VeloxUserError`), the JVM receives a `GlutenException` instead.
## Expected Behavior
The JVM-side error translation layer should detect Velox errors for invalid bitmap positions and re-throw them as `SparkArrayIndexOutOfBoundsException` with the appropriate `INVALID_BITMAP_POSITION` error condition, preserving Spark error API compatibility.
## References
- PR: #12142
- Error condition: `INVALID_BITMAP_POSITION` (introduced in Spark 3.5)
- Relevant test: `QueryExecutionErrorsSuite` lines 952, 966
Contributor guide
Research direction
Start with QueryExecutionErrorsSuite around lines 952 and 966, then inspect the JVM-side error translation layer and the VeloxTestSettings exclusions introduced in PR #12142. Trace how invalid bitmap positions reach the JVM and verify that both out-of-bounds cases produce SparkArrayIndexOutOfBoundsException with INVALID_BITMAP_POSITION; restore the relevant tests when they pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100