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
next_day and make_date ANSI errors surface as CometNativeException instead of Spark exception classes #5073
next_day and make_date honor ANSI mode correctly (throw vs NULL), and make_date even reproduces the java.time message text and validation order faithfully. But both raise plain DataFusionError::Execution strings instead of SparkError variants, so under ANSI they surface as CometNativeException instead of the Spark exception types:
next_day with an invalid day name (native/spark-expr/src/datetime_funcs/next_day.rs:146-155): Spark throws SparkIllegalArgumentException with error class ILLEGAL_DAY_OF_WEEK, SQLSTATE 22009. Comet throws a generic exception with only the message substring "Illegal input for day of week: ...".
make_date with out-of-range fields (native/spark-expr/src/datetime_funcs/make_date.rs:177-187): Spark throws SparkDateTimeException with error class DATETIME_FIELD_OUT_OF_BOUNDS.WITH_SUGGESTION, SQLSTATE 22023, including the spark.sql.ansi.enabled suggestion sentence. Comet emits only the inner range message.
native/common/src/error.rs has no variants for these two error classes; adding e.g. IllegalDayOfWeek { input } and DatetimeFieldOutOfBounds { range_message } and routing them through the existing JSON conversion path (as done for cast and arithmetic ANSI errors, ShimSparkErrorConverter) closes the gap.
Existing tests (spark/src/test/resources/sql-tests/expressions/datetime/next_day_ansi.sql, make_date_ansi.sql) assert message substrings only, so they pass despite the wrong exception type.
Minor related note: Spark flips MakeDate.nullable to depend on child nullability when failOnError is set (datetimeExpressions.scala:2570); Comet does not model this.
Activity
docs: document known correctness issues in the compatibility guide (#…
peterxcli commentedon Jul 31, 2026
take
docs: drop compatibility notes for bugs that are now fixed
docs: drop compatibility notes for bugs that are now fixed (#5154)
docs: document known correctness issues in the compatibility guide (a…
docs: drop compatibility notes for bugs that are now fixed (apache#5154)
address review: drop stale docs bullets, harden CheckedBinaryExpr unw…
fix: native ansi-errors raised as spark error (apache#5169)