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
CometRegExpJvmSuite walks the chain to inspect exception class names.
ParquetReadSuite walks the chain to find SchemaColumnConvertNotSupportedException.
CometExecSuite contains two copies that inspect exception messages.
CometExpressionSuite defines arithmeticError, which independently walks the chain to find a SparkArithmeticException.
This duplicates null termination, ordering, and diagnostic behavior across six call sites in five suites.
Other code in CometExpressionSuite, CometDppFallbackRepro3949Suite, CometSQLQueryTestHelper, and CometCastSuite intentionally uses bounded, root-only, or one-level unwrapping semantics and should not be changed automatically.
Describe the potential solution
Add one protected causeChain(error: Throwable): Seq[Throwable] helper to CometTestBase and migrate these cause-chain walks to it.
Keep deepestSparkThrowable local to CometTemporalExpressionSuite because selecting the deepest structured Spark exception is currently unique policy; it can use the inherited causeChain helper. Do not introduce a universal structured-exception comparator or change tests that intentionally inspect only one cause level.
Validate that the migrated tests preserve outer-to-inner ordering and behavior across supported Spark versions.
What is the problem the feature request solves?
Several Comet test suites independently implement the same
Throwable.getCausetraversal:CometTemporalExpressionSuitedefinescauseChainfor structured Spark exception checks added in fix: surface next_day and make_date ANSI errors as Spark exceptions #5167.CometRegExpJvmSuitewalks the chain to inspect exception class names.ParquetReadSuitewalks the chain to findSchemaColumnConvertNotSupportedException.CometExecSuitecontains two copies that inspect exception messages.CometExpressionSuitedefinesarithmeticError, which independently walks the chain to find aSparkArithmeticException.This duplicates null termination, ordering, and diagnostic behavior across six call sites in five suites.
Other code in
CometExpressionSuite,CometDppFallbackRepro3949Suite,CometSQLQueryTestHelper, andCometCastSuiteintentionally uses bounded, root-only, or one-level unwrapping semantics and should not be changed automatically.Describe the potential solution
Add one protected
causeChain(error: Throwable): Seq[Throwable]helper toCometTestBaseand migrate these cause-chain walks to it.Keep
deepestSparkThrowablelocal toCometTemporalExpressionSuitebecause selecting the deepest structured Spark exception is currently unique policy; it can use the inheritedcauseChainhelper. Do not introduce a universal structured-exception comparator or change tests that intentionally inspect only one cause level.Validate that the migrated tests preserve outer-to-inner ordering and behavior across supported Spark versions.
Additional context
Raised while addressing review feedback on #5167.