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
Background
When
bitmap_construct_aggis offloaded to native Velox execution, invalid bitmap positions throw aGlutenException(wrappingVeloxUserError) instead of the expectedSparkArrayIndexOutOfBoundsExceptionwith error conditionINVALID_BITMAP_POSITION.Current State
In PR #12142, we excluded the following error-path tests from
VeloxTestSettingsas a workaround:INVALID_BITMAP_POSITION: position out of boundsINVALID_BITMAP_POSITION: negative positionThese tests verify that Spark throws
SparkArrayIndexOutOfBoundsExceptionfor out-of-bounds and negative positions inbitmap_construct_agg. Since Velox produces its own error format (VeloxUserError), the JVM receives aGlutenExceptioninstead.Expected Behavior
The JVM-side error translation layer should detect Velox errors for invalid bitmap positions and re-throw them as
SparkArrayIndexOutOfBoundsExceptionwith the appropriateINVALID_BITMAP_POSITIONerror condition, preserving Spark error API compatibility.References
INVALID_BITMAP_POSITION(introduced in Spark 3.5)QueryExecutionErrorsSuitelines 952, 966