Repository navigation
[spark] Add an isolated Spark 4.3 connector build #11246
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
Open
LuciferYang
wants to merge
4
commits into
apache:master
Choose a base branch
from
LuciferYang:spark43-connector
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+564
−26
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d7ac0b3
[spark] Add an isolated Spark 4.3 connector build
LuciferYang 02f9132
Merge remote-tracking branch 'upstream/master' into spark43-connector
LuciferYang b66bcaa
[spark] Bring the Spark 4.3 module up to date with master
LuciferYang 28a7ef8
[spark] Compile the Spark 4.2 module sources in the Spark 4.3 module
LuciferYang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,219 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| --> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>org.apache.paimon</groupId> | ||
| <artifactId>paimon-spark</artifactId> | ||
| <version>2.2-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <artifactId>paimon-spark-4.3_2.13</artifactId> | ||
| <name>Paimon : Spark : 4.3 : 2.13</name> | ||
|
|
||
| <!-- | ||
| Compiles `paimon-spark-4.2`'s main and test sources against Spark 4.3, so both connectors share | ||
| one copy. This module owns only its NOTICE and the tests that need Spark 4.3 APIs. | ||
| --> | ||
| <properties> | ||
| <spark.version>4.3.0</spark.version> | ||
| <scala.binary.version>2.13</scala.binary.version> | ||
| <scala.version>2.13.18</scala.version> | ||
| <spark42.module.dir>${project.basedir}/../paimon-spark-4.2</spark42.module.dir> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.networknt</groupId> | ||
| <artifactId>json-schema-validator</artifactId> | ||
| <version>2.0.0</version> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-databind</artifactId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <groupId>com.fasterxml.jackson.dataformat</groupId> | ||
| <artifactId>jackson-dataformat-yaml</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.yaml</groupId> | ||
| <artifactId>snakeyaml</artifactId> | ||
| <version>2.5</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.paimon</groupId> | ||
| <artifactId>paimon-format</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.paimon</groupId> | ||
| <artifactId>paimon-spark4-common_${scala.binary.version}</artifactId> | ||
| <version>${project.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-sql-api_${scala.binary.version}</artifactId> | ||
| <version>${spark.version}</version> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-connect-shims_${scala.binary.version}</artifactId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <groupId>org.apache.logging.log4j</groupId> | ||
| <artifactId>log4j-slf4j2-impl</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-core_${scala.binary.version}</artifactId> | ||
| <version>${spark.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-sql_${scala.binary.version}</artifactId> | ||
| <version>${spark.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-catalyst_${scala.binary.version}</artifactId> | ||
| <version>${spark.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-hive_${scala.binary.version}</artifactId> | ||
| <version>${spark.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-sql_${scala.binary.version}</artifactId> | ||
| <version>${spark.version}</version> | ||
| <classifier>tests</classifier> | ||
| <scope>test</scope> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-connect-shims_${scala.binary.version}</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-catalyst_${scala.binary.version}</artifactId> | ||
| <version>${spark.version}</version> | ||
| <classifier>tests</classifier> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-core_${scala.binary.version}</artifactId> | ||
| <version>${spark.version}</version> | ||
| <classifier>tests</classifier> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <resources> | ||
| <resource> | ||
| <directory>src/main/resources</directory> | ||
| </resource> | ||
| <resource> | ||
| <directory>${spark42.module.dir}/src/main/resources</directory> | ||
| <excludes> | ||
| <exclude>META-INF/NOTICE</exclude> | ||
| </excludes> | ||
| </resource> | ||
| </resources> | ||
|
|
||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.codehaus.mojo</groupId> | ||
| <artifactId>build-helper-maven-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <id>add-spark42-sources</id> | ||
| <phase>generate-sources</phase> | ||
| <goals> | ||
| <goal>add-source</goal> | ||
| </goals> | ||
| <configuration> | ||
| <sources> | ||
| <source>${spark42.module.dir}/src/main/scala</source> | ||
| </sources> | ||
| </configuration> | ||
| </execution> | ||
| <execution> | ||
| <id>add-spark42-test-sources</id> | ||
| <phase>generate-test-sources</phase> | ||
| <goals> | ||
| <goal>add-test-source</goal> | ||
| </goals> | ||
| <configuration> | ||
| <sources> | ||
| <source>${spark42.module.dir}/src/test/scala</source> | ||
| </sources> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
|
|
||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-shade-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <id>shade-paimon</id> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>shade</goal> | ||
| </goals> | ||
| <configuration> | ||
| <artifactSet> | ||
| <includes combine.children="append"> | ||
| <include>org.apache.paimon:paimon-spark4-common_${scala.binary.version}</include> | ||
| <include>com.networknt:json-schema-validator</include> | ||
| <include>com.ethlo.time:itu</include> | ||
| </includes> | ||
| </artifactSet> | ||
| <relocations> | ||
| <relocation> | ||
| <pattern>com.networknt</pattern> | ||
| <shadedPattern>org.apache.paimon.spark.shade.networknt</shadedPattern> | ||
| </relocation> | ||
| <relocation> | ||
| <pattern>com.ethlo.time</pattern> | ||
| <shadedPattern>org.apache.paimon.spark.shade.time</shadedPattern> | ||
| </relocation> | ||
| </relocations> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> | ||
12 changes: 12 additions & 0 deletions
12
paimon-spark/paimon-spark-4.3/src/main/resources/META-INF/NOTICE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| paimon-spark-4.3 | ||
| Copyright 2023-2026 The Apache Software Foundation | ||
|
|
||
| This product includes software developed at | ||
| The Apache Software Foundation (http://www.apache.org/). | ||
|
|
||
| This project bundles the following dependencies under the Apache Software License 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) | ||
| - com.networknt:json-schema-validator:2.0.0 | ||
| - com.ethlo.time:itu:1.14.0 | ||
|
|
||
| The bundled Ossie JSON Schema is from Apache Ossie (incubating), commit | ||
| 2692b1cc4708fdcf6a91e597ca928a9bc9d0da60, under the Apache Software License 2.0. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All 4 production sources (
OssieModel.scala,OssieSql.scala,OssieToSparkMetricView.scala,PaimonSemanticViewResolver.scala),ossie-0.3.0.dev0.schema.json,Spark4xRowTest.scala, andOssieModelTest.scalainpaimon-spark-4.3are byte-for-byte identical copies ofpaimon-spark-4.2, andOssieSemanticViewTest.scala/Spark43CompatibilityTest.scalaonly differ byspark.sql.analyzer.singlePassResolver.dualRunWithLegacy=false(plus two 4.3-specific tests).As seen in commit
b66bcaab, duplicating ~2,265 lines across both modules means every change to Ossie semantic views or compatibility tests inpaimon-spark-4.2(like#11237,#11238, and#11267) has to be manually copy-pasted intopaimon-spark-4.3.Could we share the sources/resources/tests from
../paimon-spark-4.2viabuild-helper-maven-plugin(add-source/add-test-source) and<resources>(similar topaimon-spark-ut-4.0/pom.xml, or via a shared source directory inpaimon-spark4-common), and keep only the Spark 4.3-specific test additions inpaimon-spark-4.3?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reconsidering, I think this is a good suggestion. Thank you @Akash3121
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 28a7ef8.
paimon-spark-4.3no longer has its own copy:build-helperadds the main and test sources ofpaimon-spark-4.2, and<resources>takes its resources exceptMETA-INF/NOTICE. The 4.3 module keeps only its NOTICE and aSpark43CompatibilityTestforsplitStatements, which needs a 4.3 API. The two REPLACE TABLE cases moved intoSpark42CompatibilityTest, so both connectors run them. ThedualRunWithLegacy=falsesetting moved into the 4.2 tests too; Spark 4.2 already defaults it tofalse.