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 3.5: Migrate tests in SQL directory to JUnit5 #9401

Merged
merged 7 commits into from Jan 10, 2024

Conversation

chinmay-bhat
Copy link
Contributor

This PR migrates the tests in spark/sql directory to JUnit5.

Issue: #9086

@github-actions github-actions bot added the spark label Jan 3, 2024
scalarSql("SELECT count(*) FROM %s", newTableName));
assertThat(scalarSql("SELECT count(*) FROM %s", newTableName))
.as("Should have " + values.size() + " row")
.isEqualTo((long) values.size());
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 these casts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, not needed. Will update this too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looking at the failed tests, we apparently do need the casts.
Line 48 shows in the schema, the id is a long.

  private static final Schema schema =
      new Schema(
          Types.NestedField.required(1, "id", Types.LongType.get()),
          Types.NestedField.required(2, "ts", Types.TimestampType.withoutZone()),
          Types.NestedField.required(3, "tsz", Types.TimestampType.withZone()));

scalarSql() returns the id of the row. As its a long, we should continue using the casts.

Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

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

almost ready to go, just a few minor things

@chinmay-bhat
Copy link
Contributor Author

Thanks for the review, @nastra! I've made the suggested changes

Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @chinmay-bhat

@nastra nastra merged commit 53a1c86 into apache:main Jan 10, 2024
31 checks passed
@chinmay-bhat chinmay-bhat deleted the junit5-spark-sql-dir branch January 15, 2024 15:08
geruh pushed a commit to geruh/iceberg that referenced this pull request Jan 26, 2024
adnanhemani pushed a commit to adnanhemani/iceberg that referenced this pull request Jan 30, 2024
devangjhabakh pushed a commit to cdouglas/iceberg that referenced this pull request Apr 22, 2024
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.

None yet

2 participants