Skip to content

[SPARK-51987][SPARK-52235][SQL][FOLLOW-UP] Add ANSI mode check for new tests #51092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from

Conversation

szehon-ho
Copy link
Member

What changes were proposed in this pull request?

Fix non-ANSI test breakage as per #50959 (review)

Why are the changes needed?

Many V2 Expressions are only converted successfully in ANSI mode, so this test for V2 Expression only makes sense in that mode.

Does this PR introduce any user-facing change?

No, test only

How was this patch tested?

Run test in NON-ANSI mode

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Jun 5, 2025
@szehon-ho
Copy link
Member Author

Test failure look unrelated, re-running

"1",
new V2Cast(LiteralValue(1, IntegerType), IntegerType, DoubleType),
LiteralValue(1.0, DoubleType))))
withSQLConf(SQLConf.ANSI_ENABLED.key -> "true") {
Copy link
Contributor

Choose a reason for hiding this comment

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

to avoid similar issues in the future, can we turn on ANSI for the entire test suite? we can override def sparkConf like https://github.com/apache/spark/blob/master/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQuerySuite.scala#L32

Copy link
Member Author

Choose a reason for hiding this comment

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

yea let me do that

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm it didnt work, i think this goes to another sparkconf that's not used by this suite? I guess that's why there's a separate before to override the conf, i put it there.

@@ -43,6 +43,7 @@ class DataSourceV2DataFrameSuite
before {
spark.conf.set("spark.sql.catalog.testcat", classOf[InMemoryTableCatalog].getName)
spark.conf.set("spark.sql.catalog.testcat2", classOf[InMemoryTableCatalog].getName)
spark.conf.set(SQLConf.ANSI_ENABLED.key, "true")
Copy link
Contributor

Choose a reason for hiding this comment

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

This works but we shouldn't set this conf repeatedly for each test case. I still prefer to override def sparkConf to set the conf once for the entire suite.

szehon-ho and others added 3 commits June 5, 2025 15:07
…rceV2DataFrameSuite.scala

Co-authored-by: Wenchen Fan <cloud0fan@gmail.com>
@cloud-fan cloud-fan changed the title [SPARK-52235][SQL][FOLLOW-UP] Add ANSI mode check for new tests [SPARK-51987][SPARK-52235][SQL][FOLLOW-UP] Add ANSI mode check for new tests Jun 6, 2025
@szehon-ho
Copy link
Member Author

Thanks! Sorry should have seen its cleared by after()

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in ec120fd Jun 6, 2025
yhuang-db pushed a commit to yhuang-db/spark that referenced this pull request Jun 9, 2025
…w tests

### What changes were proposed in this pull request?
Fix non-ANSI test breakage as per apache#50959 (review)

### Why are the changes needed?
Many V2 Expressions are only converted successfully in ANSI mode, so this test for V2 Expression only makes sense in that mode.

### Does this PR introduce _any_ user-facing change?
No, test only

### How was this patch tested?
Run test in NON-ANSI mode

### Was this patch authored or co-authored using generative AI tooling?
No

Closes apache#51092 from szehon-ho/SPARK-52235-follow.

Lead-authored-by: Szehon Ho <szehon.apache@gmail.com>
Co-authored-by: Wenchen Fan <wenchen@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants