Skip to content

test: enable ignored 4.0 tests, enable ansi mode#3454

Open
parthchandra wants to merge 2 commits intoapache:mainfrom
parthchandra:spark-4.0-support
Open

test: enable ignored 4.0 tests, enable ansi mode#3454
parthchandra wants to merge 2 commits intoapache:mainfrom
parthchandra:spark-4.0-support

Conversation

@parthchandra
Copy link
Contributor

enabling tests that fail in 4.0, and with ansi mode enabled to see what still fails

@parthchandra parthchandra marked this pull request as draft February 9, 2026 11:28
@parthchandra parthchandra changed the title [DRAFT] test: enable ignored 4.0 tests, enable ansi mode test: [DRAFT] enable ignored 4.0 tests, enable ansi mode Feb 9, 2026
@parthchandra parthchandra force-pushed the spark-4.0-support branch 2 times, most recently from eedc50a to e08426c Compare March 9, 2026 18:18
@parthchandra parthchandra marked this pull request as ready for review March 9, 2026 19:41
@parthchandra parthchandra changed the title test: [DRAFT] enable ignored 4.0 tests, enable ansi mode test: enable ignored 4.0 tests, enable ansi mode Mar 9, 2026
@@ -231,6 +231,11 @@ class FallbackStorageSuite extends SparkFunSuite with LocalSparkContext {
}

test("Upload from all decommissioned executors") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these tests just be tagged with IgnoreComet rather than adding code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IgnoreComet only works with tests extending SQLTestUtils (which overrides the test method). FallbackStorageSuite is a core module test and does not extendt SQLTestUtils.
To override the test method in SparkFunSuite and also in SQLTestUtils one would end up probably creating a new mixin trait for IgnoreComet tests and I didn't want to complicate things with this PR. Also, it doesn't seem like we are likely to need it too often in core modules.

Comment on lines 3666 to 3670
+ */
+ protected def enableCometAnsiMode: Boolean = {
+ val v = System.getenv("ENABLE_COMET_ANSI_MODE")
+ v != null && v.toBoolean
+ if (v != null) v.toBoolean else true
+ }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method can be removed. We no longer have a config in Comet for this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(of course, can be done in a separate PR)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, nm, it looks like this is for enabling Spark ANSI mode, not Comet ANSI mode, so maybe the method name and env var name are just confusing. I will take another look at this tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spark 4 Ansi mode is the default. This may be leftover from 3.5.

Copy link
Contributor

@kazuyukitanimura kazuyukitanimura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @parthchandra

Comment on lines +1586 to +1595
@@ -390,7 +396,8 @@ class KeyGroupedPartitioningSuite extends DistributionAndOrderingSuiteBase {
assert(collectAllShuffles(df.queryExecution.executedPlan).isEmpty,
"should contain no shuffle when sorting by partition values")
} else {
- assert(collectAllShuffles(df.queryExecution.executedPlan).size == 1,
+ val s = collectAllShuffles(df.queryExecution.executedPlan)
+ assert(s.size == 1,
"should contain one shuffle when optimization is disabled")
}
checkAnswer(df, answer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this part of diff?

+ protected def enableCometAnsiMode: Boolean = {
+ val v = System.getenv("ENABLE_COMET_ANSI_MODE")
+ v != null && v.toBoolean
+ if (v != null) v.toBoolean else true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If enabling by default, is it more like

v == null || v == "1" || v.toBoolean

case GlobalLimitExec(_, s: SortExec, _) => !s.global
case GlobalLimitExec(_, ProjectExec(_, s: SortExec), _) => !s.global
+ case CometGlobalLimitExec(_, _, _, _, s: CometSortExec, _) =>
+ !s.originalPlan.asInstanceOf[SortExec].global
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need b, I guess we can directly return find

@parthchandra
Copy link
Contributor Author

@kazuyukitanimura @andygrove thank you for looking at this PR. I found an issue with this diff. Let me change this to draft.

@parthchandra parthchandra marked this pull request as draft March 10, 2026 22:36
@parthchandra parthchandra marked this pull request as ready for review March 11, 2026 23:14
@parthchandra
Copy link
Contributor Author

@andygrove @kazuyukitanimura this is ready for review again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants