Skip to content
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

[Spark] [Test only] Fix Spark Master test in DeltaSourceSuite #3088

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,7 @@ class DeltaSourceSuite extends DeltaSourceSuiteBase
}
}

testSparkLatestOnly("startingVersion: user defined start works with mergeSchema") {
test("startingVersion: user defined start works with mergeSchema") {
withTempDir { inputDir =>
withTempView("startingVersionTest") {
spark.range(10)
Expand Down Expand Up @@ -1774,10 +1774,13 @@ class DeltaSourceSuite extends DeltaSourceSuiteBase
q.processAllAvailable()
checkAnswer(
sql("select * from startingVersionTest"),
((10 until 20).map(x => (x.toLong, x.toLong, None.toString)) ++
((10 until 20).map(x => (x.toLong, x.toLong, "null")) ++
(20 until 30).map(x => (x.toLong, x.toLong, x.toString)))
.toDF("id", "id2", "id3")
.selectExpr("id", "id2", "cast(id3 as long) as id3")
.selectExpr(
"id",
"id2",
"CASE WHEN id3 = 'null' THEN NULL ELSE cast(id3 as long) END as id3")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the behavior of cast changed in Spark master? Why do we need this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes it did change. Spark Master enables ANSI SQL mode by default

)
} finally {
q.stop()
Expand Down
Loading