Skip to content

Commit

Permalink
[Flink] Verify primary keys and partition keys during create table (l…
Browse files Browse the repository at this point in the history
…akesoul-io#475)

* verify primary keys and partition keys during create table

Signed-off-by: chenxu <[email protected]>

* remove flink-python dep

Signed-off-by: chenxu <[email protected]>

* debug github maven action

Signed-off-by: chenxu <[email protected]>

* debug maven build failure on github action

Signed-off-by: chenxu <[email protected]>

* update flink pom

Signed-off-by: chenxu <[email protected]>

* upgrade to java 11

Signed-off-by: chenxu <[email protected]>

* try..

Signed-off-by: chenxu <[email protected]>

---------

Signed-off-by: chenxu <[email protected]>
Co-authored-by: chenxu <[email protected]>
  • Loading branch information
xuchen-plus and dmetasoul01 authored May 8, 2024
1 parent b27580f commit e2c0d14
Show file tree
Hide file tree
Showing 13 changed files with 44,627 additions and 83 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/flink-cdc-hdfs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
docker-images: true
swap-storage: true
- uses: actions/checkout@v4
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Set up Python 3.9
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
mkdir -p rust/target/release
cp rust/target/x86_64-unknown-linux-gnu/release/liblakesoul_io_c.so rust/target/release
cp rust/target/x86_64-unknown-linux-gnu/release/liblakesoul_metadata_c.so rust/target/release
MAVEN_OPTS="-Xmx4000m" mvn -q -B package -f pom.xml -Pcross-build -DskipTests
MAVEN_OPTS="-Xmx4000m" mvn -q -B clean package -f pom.xml -Pcross-build -DskipTests
- name: Get jar names
run: |
echo "FLINK_JAR_NAME=$(python script/get_jar_name.py lakesoul-flink)" >> $GITHUB_ENV
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/flink-cdc-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
docker-images: true
swap-storage: true
- uses: actions/checkout@v4
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Set up Python 3.9
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
mkdir -p rust/target/release
cp rust/target/x86_64-unknown-linux-gnu/release/liblakesoul_io_c.so rust/target/release
cp rust/target/x86_64-unknown-linux-gnu/release/liblakesoul_metadata_c.so rust/target/release
MAVEN_OPTS="-Xmx4000m" mvn -q -B package -f pom.xml -Pcross-build -DskipTests
MAVEN_OPTS="-Xmx4000m" mvn -q -B clean package -f pom.xml -Pcross-build -DskipTests
- name: Get jar names
run: |
echo "FLINK_JAR_NAME=$(python script/get_jar_name.py lakesoul-flink)" >> $GITHUB_ENV
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/maven-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven
- uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -93,10 +93,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Install psql
Expand Down Expand Up @@ -161,10 +161,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Install psql
Expand Down Expand Up @@ -229,10 +229,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Install psql
Expand Down Expand Up @@ -309,10 +309,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Install psql
Expand All @@ -335,7 +335,7 @@ jobs:
path: ./rust/target/release/
- name: Build with Maven
run: |
MAVEN_OPTS="-Xmx5g" mvn -B test -pl lakesoul-flink -am -Pcross-build --file pom.xml -Dtest='!LakeSoulRBACTest' -Dsurefire.failIfNoSpecifiedTests=false
MAVEN_OPTS="-Xmx5g" mvn -B clean test -pl lakesoul-flink -am -Pcross-build --file pom.xml -Dtest='!LakeSoulRBACTest' -Dsurefire.failIfNoSpecifiedTests=false
- name: Generate Report Site
if: always()
run: |
Expand Down Expand Up @@ -377,10 +377,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Install psql
Expand Down Expand Up @@ -422,7 +422,7 @@ jobs:
path: ./rust/target/release/
- name: Build with Maven
run: |
MAVEN_OPTS="-Xmx5g" mvn -B test -pl lakesoul-flink -am -Pcross-build --file pom.xml -Dtest='LakeSoulRBACTest' -Dsurefire.failIfNoSpecifiedTests=false
MAVEN_OPTS="-Xmx5g" mvn -B clean test -pl lakesoul-flink -am -Pcross-build --file pom.xml -Dtest='LakeSoulRBACTest' -Dsurefire.failIfNoSpecifiedTests=false
- name: Generate Report Site
if: always()
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ jobs:
with:
name: lakesoul-nativemetadata-x86_64-pc-windows-msvc
path: ./rust/target/release/
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Install Protoc
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/presto-cdc-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
docker-images: true
swap-storage: true
- uses: actions/checkout@v4
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Set up Python 3.9
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
mkdir -p rust/target/release
cp rust/target/x86_64-unknown-linux-gnu/release/liblakesoul_io_c.so rust/target/release
cp rust/target/x86_64-unknown-linux-gnu/release/liblakesoul_metadata_c.so rust/target/release
MAVEN_OPTS="-Xmx4000m" mvn -q -B package -f pom.xml -Pcross-build -DskipTests
MAVEN_OPTS="-Xmx4000m" mvn -q -B clean package -f pom.xml -Pcross-build -DskipTests
- name: Get jar names
run: |
echo "FLINK_JAR_NAME=$(python script/get_jar_name.py lakesoul-flink)" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion lakesoul-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ SPDX-License-Identifier: Apache-2.0
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.8.1</version>
<version>4.9.0</version>
<executions>
<execution>
<id>scala-compile-first</id>
Expand Down
92 changes: 45 additions & 47 deletions lakesoul-flink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ SPDX-License-Identifier: Apache-2.0
<version>1.17-${revision}</version>
<properties>
<flink.version>1.17.1</flink.version>
<scala.binary.version>2.12</scala.binary.version>
<scala.version>2.12.10</scala.version>
<log4j.version>2.17.2</log4j.version>
<cdc.version>3.0.0</cdc.version>
<local.scope>provided</local.scope>
</properties>

<dependencies>
Expand Down Expand Up @@ -221,11 +218,6 @@ SPDX-License-Identifier: Apache-2.0
<version>${flink.version}</version>
<scope>${local.scope}</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-python</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils</artifactId>
Expand Down Expand Up @@ -313,6 +305,16 @@ SPDX-License-Identifier: Apache-2.0
<groupId>org.apache.spark</groupId>
<artifactId>spark-unsafe_${scala.binary.version}</artifactId>
<version>${spark.version}</version>
<exclusions>
<exclusion>
<groupId>org.scala-lang</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.twitter</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand All @@ -330,37 +332,10 @@ SPDX-License-Identifier: Apache-2.0

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<skip>false</skip>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>LakeSoulPrestoTest</exclude>
<exclude>LakeSoulRBACTest</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.6.3</version>
<version>4.9.0</version>
<executions>
<execution>
<id>scala-compile-first</id>
Expand All @@ -382,7 +357,7 @@ SPDX-License-Identifier: Apache-2.0
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.13.0</version>
<executions>
<execution>
<phase>compile</phase>
Expand All @@ -392,6 +367,33 @@ SPDX-License-Identifier: Apache-2.0
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<skip>false</skip>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>LakeSoulPrestoTest</exclude>
<exclude>LakeSoulRBACTest</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down Expand Up @@ -428,7 +430,6 @@ SPDX-License-Identifier: Apache-2.0
<include>com.zaxxer:HikariCP</include>
<include>org.postgresql:postgresql</include>
<include>com.alibaba:fastjson</include>
<include>org.apache.flink:flink-python</include>
<include>org.apache.spark:spark-core_${scala.binary.version}</include>
<include>org.apache.spark:spark-catalyst_${scala.binary.version}</include>
<include>org.apache.spark:spark-unsafe_${scala.binary.version}</include>
Expand Down Expand Up @@ -483,13 +484,6 @@ SPDX-License-Identifier: Apache-2.0
<exclude>org/apache/arrow/c/jni/JniLoader.class</exclude>
</excludes>
</filter>
<filter>
<artifact>org.apache.flink:flink-python</artifact>
<includes>
<include>org/apache/flink/fnexecution/v1/**</include>
<include>org/apache/flink/api/python/shaded/com/google/protobuf/**</include>
</includes>
</filter>
</filters>
<relocations>
<relocation>
Expand Down Expand Up @@ -517,8 +511,12 @@ SPDX-License-Identifier: Apache-2.0
<shadedPattern>com.lakesoul.shaded.org.apache.spark</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.flink.table.runtime.arrow</pattern>
<shadedPattern>com.lakesoul.shaded.org.apache.flink.table.runtime.arrow</shadedPattern>
<pattern>org.apache.flink.table.runtime</pattern>
<shadedPattern>com.lakesoul.shaded.org.apache.flink.table.runtime</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.flink.fnexecution</pattern>
<shadedPattern>com.lakesoul.shaded.org.apache.flink.fnexecution</shadedPattern>
</relocation>
<relocation>
<pattern>io.netty</pattern>
Expand Down
Loading

0 comments on commit e2c0d14

Please sign in to comment.