Migrate DDL sub-classes in spark-extensions to JUnit5 and AssertJ style#9624
Migrate DDL sub-classes in spark-extensions to JUnit5 and AssertJ style#9624nastra merged 5 commits intoapache:mainfrom
Conversation
depending on the size of the diff it's also fine to split this into 2-3 PRs. You could probably start within a specific package and combine subclasses within one or more packages together in a PR (again depending on the size of the diff). |
|
Sure, thank you for the suggestion. The size of diff would be a bit big if I gather all the diffs in |
|
@nastra Change the following 7 DDL extensions to JUnit 5 and AssertJ style.
For now If I need to add more classes in this PR, please let me know. |
| table.manageSnapshots().createBranch(branchName, first).commit(); | ||
| SnapshotRef b1 = table.refs().get(branchName); | ||
| Integer minSnapshotsToKeep = b1.minSnapshotsToKeep(); | ||
| Long maxSnapshotAgeMs = b1.maxSnapshotAgeMs(); |
There was a problem hiding this comment.
why are these being removed?
There was a problem hiding this comment.
The sql in this test is like ALTER TABLE catalog.db.tbl REPLACE BRANCH branch AS OF VERSION snapshotId RETAIN maxRefAge timeUnit. For this query, the minSnapshotsToKeep and maxSnapshotAgeMs are always null in the current impl. If the query has WITH SNAPSHOT RETENTION the parameters are filled. So I remove this part and change the tests to null checks.
There was a problem hiding this comment.
ok thanks for confirming, no need to change anything as I think being explicit and making sure those are null is good in this case
| import org.apache.spark.sql.internal.SQLConf; | ||
| import org.assertj.core.api.Assertions; | ||
| import org.junit.After; | ||
| import org.junit.Assert; |
nastra
left a comment
There was a problem hiding this comment.
this looks almost ready to go, just 2 comments. Also the diff size is about right for reviewing.
|
Thanks so much for the review. Will create a PR for other sub-classes. |
Migrate sub-classes in spark-extension to JUnit 5 along with #9613, and #9086.
For now, only one test
TestAlterTablePartitionFieldsis updated with JUnit 5. Will addallDDL sub-classes in this PR.Current progress
TestViews will be separately created because of the code size (~ 1400 lines).