You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ANSI mode test coverage: re-enable stale ignored tests and add missing cases #5076
An ANSI-mode audit against Spark 4.1.1 found several test-coverage gaps around ANSI behavior. Closing them locks in the behavior that is already correct and captures the known divergences as regression tests.
Stale disabled tests to re-enable:
spark/src/test/resources/sql-tests/expressions/array/element_at_ansi.sql and array/get_array_item_ansi.sql are entirely query ignore(#3375) with comments claiming "Comet throws: different error message". ANSI mode array access error messages don't match Spark format #3375 is closed: the error-message work merged (native GetArrayItem re-enabled shortly after), and CometArrayExpressionSuite now asserts exact Spark message parity for both expressions. These files should be un-ignored.
round: no ANSI case at all; also no integral negative-scale overflow case in any mode.
conv: no ANSI overflow case (e.g. conv('FFFFFFFFFFFFFFFFF', 16, 10) throws under ANSI).
elt: no out-of-range index case, no ANSI config.
Specific untested inputs surfaced by the audit (each is the repro for a filed bug; add as query ignore(<issue-url>) until fixed, then un-ignore):
Long.MinValue div -1 under ANSI (IntegralDivide overflow).
CAST(1.0 AS DOUBLE) % CAST(0.0 AS DOUBLE) under ANSI (float remainder by zero).
CAST(true AS DECIMAL(1,1)) in legacy/try mode (boolean-to-decimal overflow).
round(5000000000000000000L, -19) in both modes.
Assertion strength: several suites assert only on message substrings, which is why wrong-exception-type divergences pass today (decimal div-by-zero, next_day, make_date, decimal-to-decimal cast). Where the error class is expected to match, assert on the exception type / getCondition() rather than substrings, and remove the decimal-to-decimal special case at CometCastSuite.scala:2402-2405 once the underlying issue is fixed.
Additional context
Found by an ANSI-mode audit of all native expressions against Spark 4.1.1.
This is done: #5798 re-enabled the element_at and get_array_item ANSI files, #5799 added the round, conv and elt ANSI cases along with the listed repros, and #5800 moved the arithmetic assertions to error class and SQLSTATE parity. The decimal-to-decimal special case in CometNativeCastSuite is the only leftover, and it goes away with the #5072 fix in #5169.
Activity
rich7420 commentedon Sep 9, 2026
take
rich7420 commentedon Sep 9, 2026
I plan to split this into three focused PRs:
get_array_itemandelement_atANSI tests.round,convandeltcoverage, including the listed overflow, division and cast regressions.I'll start with array access. Cases blocked by open bugs will retain their tracking links until fixed.
andygrove commentedon Sep 28, 2026
This is done: #5798 re-enabled the element_at and get_array_item ANSI files, #5799 added the round, conv and elt ANSI cases along with the listed repros, and #5800 moved the arithmetic assertions to error class and SQLSTATE parity. The decimal-to-decimal special case in CometNativeCastSuite is the only leftover, and it goes away with the #5072 fix in #5169.