Skip to content

Commit 417b3e9

Browse files
authored
[Spark] split auto-compact suite into config/exec suites (#5635)
<!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://github.com/delta-io/delta/blob/master/CONTRIBUTING.md 2. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP] Your PR title ...'. 3. Be sure to keep the PR description updated to reflect all changes. 4. Please write your PR title to summarize what this PR proposes. 5. If possible, provide a concise example to reproduce the issue for a faster review. 6. If applicable, include the corresponding issue number in the PR title and link it in the body. --> #### Which Delta project/connector is this regarding? <!-- Please add the component selected below to the beginning of the pull request title For example: [Spark] Title of my pull request --> - [x] Spark - [ ] Standalone - [ ] Flink - [ ] Kernel - [ ] Other (fill in here) ## Description This test-only change splits the relatively large AutoCompactSuite into AutoCompactConfigurationSuite and AutoCompactExecutionSuites. ## How was this patch tested? Test-only ## Does this PR introduce _any_ user-facing changes? No
1 parent 735230c commit 417b3e9

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

spark/src/test/scala/org/apache/spark/sql/delta/AutoCompactSuite.scala

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,20 @@ trait AutoCompactTestUtils {
5656
* This class extends the [[CompactionSuiteBase]] and runs all the [[CompactionSuiteBase]] tests
5757
* with AutoCompaction.
5858
*
59-
* It also tests any AutoCompaction specific behavior.
59+
* It also tests AutoCompaction specific behavior around configuration settings.
6060
*/
61-
class AutoCompactSuite extends
61+
class AutoCompactConfigurationSuite extends
6262
CompactionTestHelperForAutoCompaction
6363
with DeltaSQLCommandTest
6464
with SharedSparkSession
6565
with AutoCompactTestUtils
6666
with DeltaExcludedBySparkVersionTestMixinShims {
6767

68+
private def setTableProperty(log: DeltaLog, key: String, value: String): Unit = {
69+
spark.sql(s"ALTER TABLE delta.`${log.dataPath}` SET TBLPROPERTIES " +
70+
s"($key = $value)")
71+
}
72+
6873
test("auto-compact-type: test table properties") {
6974
withTempDir { tempDir =>
7075
val dir = tempDir.getCanonicalPath
@@ -107,6 +112,20 @@ class AutoCompactSuite extends
107112
}
108113
}
109114

115+
}
116+
117+
/**
118+
* This class extends the [[CompactionSuiteBase]] and runs all the [[CompactionSuiteBase]] tests
119+
* with AutoCompaction.
120+
*
121+
* It also tests AutoCompaction specific behavior around compaction execution.
122+
*/
123+
class AutoCompactExecutionSuite extends
124+
CompactionTestHelperForAutoCompaction
125+
with DeltaSQLCommandTest
126+
with SharedSparkSession
127+
with AutoCompactTestUtils
128+
with DeltaExcludedBySparkVersionTestMixinShims {
110129
private def testBothModesViaProperty(testName: String)(f: String => Unit): Unit = {
111130
def runTest(autoCompactConfValue: String): Unit = {
112131
withTempDir { dir =>
@@ -351,12 +370,22 @@ class AutoCompactSuite extends
351370
}
352371
}
353372

354-
class AutoCompactIdColumnMappingSuite extends AutoCompactSuite
373+
class AutoCompactConfigurationIdColumnMappingSuite extends AutoCompactConfigurationSuite
374+
with DeltaColumnMappingEnableIdMode {
375+
override def runAllTests: Boolean = true
376+
}
377+
378+
class AutoCompactExecutionIdColumnMappingSuite extends AutoCompactExecutionSuite
355379
with DeltaColumnMappingEnableIdMode {
356380
override def runAllTests: Boolean = true
357381
}
358382

359-
class AutoCompactNameColumnMappingSuite extends AutoCompactSuite
383+
class AutoCompactConfigurationNameColumnMappingSuite extends AutoCompactConfigurationSuite
384+
with DeltaColumnMappingEnableNameMode {
385+
override def runAllTests: Boolean = true
386+
}
387+
388+
class AutoCompactExecutionNameColumnMappingSuite extends AutoCompactExecutionSuite
360389
with DeltaColumnMappingEnableNameMode {
361390
override def runAllTests: Boolean = true
362391
}

0 commit comments

Comments
 (0)