-
Notifications
You must be signed in to change notification settings - Fork 289
Description
Describe the bug
When ANSI mode is enabled (spark.sql.ansi.enabled=true), Comet throws exceptions for out-of-bounds array access, but the error message format differs from Spark's format.
Spark Error Messages
For array[index] (GetArrayItem):
[INVALID_ARRAY_INDEX] The index X is out of bounds. The array has Y elements. Use the SQL function get() to tolerate accessing element at invalid index and return NULL instead.
For element_at(array, index) with out-of-bounds:
[INVALID_ARRAY_INDEX_IN_ELEMENT_AT] The index X is out of bounds. The array has Y elements. Use try_element_at to tolerate accessing element at invalid index and return NULL instead.
For element_at(array, 0):
[INVALID_INDEX_OF_ZERO] The index 0 is invalid. An index shall be either < 0 or > 0 (the first element has index 1).
Comet Error Messages
Comet currently throws:
org.apache.comet.CometNativeException: Index out of bounds for array
Steps to reproduce
No response
Expected behavior
No response
Additional context
No response