Commit 7f00753
authored
Spark 4 support (#452)
* Copy Spark 3.5 module to Spark 4.0 directory structure
- Copied spark-3.5/clickhouse-spark to spark-4.0/clickhouse-spark
- Copied spark-3.5/clickhouse-spark-it to spark-4.0/clickhouse-spark-it
- Copied build.gradle with module name references updated to 4.0
- This is an exact copy of Spark 3.5 code before API adaptations
- No functional changes, only directory structure and module naming
* Add Spark 4.0 API compatibility changes
- Updated AnalysisException constructor to require errorClass and messageParameters
- Updated ArrowUtils.toArrowSchema to include largeVarTypes parameter (false for compatibility)
- These are breaking API changes in Spark 4.0 that require code updates
* Update Gradle configuration for Spark 4.0 support
- Added Spark 4.0.1 version configuration to gradle.properties
- Updated ANTLR version to 4.13.1 to match Spark 4.0 dependencies
- Added Spark 4.0 examples module to settings.gradle
- Updated build.gradle with Spark 4.0 compatibility settings
* Fix test infrastructure trait linearization for Spark 4.0
- Added BeforeAndAfterAll trait to ClickHouseSingleMixIn
- Fixed trait linearization order: BeforeAndAfterAll before ForAllTestContainer
- Added logging for container lifecycle debugging
- Resolves Spark 4.0 test compilation issues with trait conflicts
* Add Spark 4.0 to CI workflows
- Added Spark 4.0 with Scala 2.13 to build-and-test workflow
- Added Spark 4.0 to check-license and style workflows with Java 17
- Added Spark 4.0 to cloud and tpcds workflows
- Excluded Spark 4.0 + Scala 2.12 combinations (not supported)
- Configured Java 17 requirement for Spark 4.0 builds
* Add Spark 4.0 debugging examples
- StreamingRateExample: Streaming app using rate source for continuous debugging
- SimpleBatchExample: Simple batch app for basic debugging scenarios
- Comprehensive README with setup and usage instructions
- Gradle and SBT build configurations for IDE support
- Examples allow setting breakpoints in connector code during execution
* Replace println with proper SLF4J logging in test fixtures
- Added Logging trait to ClickHouseSingleMixIn
- Replaced all println statements with log.info() calls
- Provides structured, filterable logging for test execution
- Maintains test output visibility while enabling proper log management
* Test all Spark versions with both Java 8 and Java 17
- Updated build-and-test.yml: Added Java 8 & 17 matrix to run-tests-with-specific-clickhouse
- Updated cloud.yml: Test all Spark 3.x versions with both Java 8 & 17
- Updated tpcds.yml: Test all Spark 3.x versions with both Java 8 & 17
- Spark 4.0 continues to use Java 17 only (requires Java 11+)
- Updated artifact names to include Java version for better debugging
* Fix CI: Remove Java 8 from run-tests-with-specific-clickhouse
ANTLR 4.13.2 (required for Spark 4.0) needs Java 11+ to compile.
The run-tests job already handles Java 8 testing for Spark 3.x versions.
This job now only uses Java 17 to avoid ANTLR compilation errors.
* Fix comments and update dependency versions
- Fix CI comments: Spark 4.0 requires Java 17+, not Java 11+
- Update commons-codec to 1.17.2 (align with Spark 4.0.1)
- Update scalatest to 3.2.19 (align with Spark 4.0.1)
- Update flexmark to 0.64.8 (latest stable)
* Combine CI test jobs into comprehensive matrix
Merged run-tests and run-tests-with-specific-clickhouse into a single job
that tests all combinations of:
- ClickHouse versions: 25.3, 25.6, 25.7, latest
- Java versions: 8, 17
- Scala versions: 2.12, 2.13
- Spark versions: 3.3, 3.4, 3.5, 4.0
With proper exclusions:
- Spark 4.0 only supports Scala 2.13
- Spark 4.0 requires Java 17+
Total: 52 test jobs (down from 64 with exclusions)
- Spark 3.x: 16 jobs each (4 CH × 2 Java × 2 Scala)
- Spark 4.0: 4 jobs (4 CH × Java 17 × Scala 2.13)
* Update ClickHouse test versions to latest releases
Changed from: 25.3, 25.6, 25.7, latest
Changed to: 25.6, 25.7, 25.8, 25.9, latest
This adds testing for newer ClickHouse versions (25.8, 25.9) while
maintaining coverage of recent stable releases. Total test jobs
increases from 52 to 65 (5 CH versions instead of 4).
* Revert flexmark to 0.62.2 for Java 8 compatibility
Flexmark 0.64.8 requires Java 11+ which breaks tests running with Java 8.
Version 0.62.2 is the last version compatible with Java 8.
* Handle missing Scala version properties gracefully
Use findProperty with fallback values in build.gradle instead of
getProperty. This allows us to omit spark_40_scala_212_version from
gradle.properties since Spark 4.0 doesn't support Scala 2.12.
If the property is missing, it falls back to sensible defaults:
- scala_212_version: 2.12.18
- scala_213_version: 2.13.81 parent 32da21c commit 7f00753
File tree
77 files changed
+9147
-56
lines changed- .github/workflows
- clickhouse-core/src/testFixtures/scala/com/clickhouse/spark/base
- spark-4.0
- clickhouse-spark-it/src/test
- resources
- scala/org/apache/spark/sql/clickhouse
- cluster
- single
- clickhouse-spark/src
- main/scala
- com/clickhouse/spark
- func
- read
- format
- write
- format
- org/apache/spark/sql/clickhouse
- test
- resources
- scala/org/apache/spark/sql/clickhouse
- examples
- src/main/scala/examples
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
77 files changed
+9147
-56
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | | - | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
27 | 37 | | |
28 | 38 | | |
29 | 39 | | |
| |||
40 | 50 | | |
41 | 51 | | |
42 | 52 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 53 | + | |
71 | 54 | | |
72 | 55 | | |
73 | 56 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
33 | 42 | | |
34 | 43 | | |
35 | 44 | | |
36 | 45 | | |
37 | 46 | | |
38 | | - | |
| 47 | + | |
39 | 48 | | |
40 | 49 | | |
41 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
39 | 47 | | |
40 | 48 | | |
41 | 49 | | |
| |||
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
47 | | - | |
| 55 | + | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
| |||
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
83 | | - | |
| 91 | + | |
84 | 92 | | |
85 | 93 | | |
86 | 94 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
34 | 43 | | |
35 | 44 | | |
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
39 | | - | |
| 48 | + | |
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
35 | 43 | | |
36 | 44 | | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
40 | | - | |
| 48 | + | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
| |||
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
51 | | - | |
| 59 | + | |
52 | 60 | | |
53 | 61 | | |
54 | 62 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| |||
168 | 172 | | |
169 | 173 | | |
170 | 174 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
| |||
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
| 42 | + | |
| 43 | + | |
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
| |||
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
83 | 106 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
55 | | - | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| |||
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
64 | | - | |
| 69 | + | |
65 | 70 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
0 commit comments