Skip to content

Commit a7b3681

Browse files
author
rockyyin
committed
feat: introduce multi-version Flink module structure (1.18/1.19/1.20)
Convert single-module project to multi-module Maven project, supporting 3 actively-supported Flink versions (1.18.1 / 1.19.1 / 1.20.0) sharing one source tree under root src/. Module structure: - Parent pom uses <dependencyManagement> for version harmonization - Each lance-flink-1.x submodule references root src/ via build-helper-maven-plugin (add-source / add-test-source / add-resource / add-test-resource) - All modules compile with Java 8 target Plugin versions kept aligned with main (PR #39): - maven-compiler-plugin 3.15.0 - maven-shade-plugin 3.6.2 - maven-jar-plugin 3.5.0 - maven-source-plugin 3.4.0 - jacoco-maven-plugin 0.8.14 Why 1.17 is excluded: - Flink 1.17 reached end-of-life on 2024-10 - Flink 1.17.x ships an internal shaded Calcite that has known bugs on JDK 8 (MetadataDef <init> assertion + safeArgList IndexOutOfBounds in CacheGeneratorUtil), causing TableEnvironment creation to fail. These are Flink-side issues, unrelated to this connector - Supporting an EOL version with upstream-broken planner is not worth the maintenance cost Notes: - Sliced from feature/flink-multi-version-modules but excludes the 4 PR #14 namespace catalog commits (those will land via their own PR) - Removes unused TableSchema import in LanceDynamicTableSource - Verified locally on JDK 8 (Tencent Kona): mvn validate / compile / test-compile / package -> BUILD SUCCESS mvn test -> 178 run, 1 failure, 0 errors, 17 skipped (per module) The single failure (LanceReadOptimizationsTest$FilterPushDown Tests.testInPredicatePushDown) is a pre-existing main bug that reproduces identically across 1.18 / 1.19 / 1.20 Closes #17 in favor of this clean slice.
1 parent facad23 commit a7b3681

8 files changed

Lines changed: 1148 additions & 312 deletions

File tree

lance-flink-1.18/pom.xml

Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>org.apache.flink</groupId>
8+
<artifactId>lance-flink-root</artifactId>
9+
<version>1.0.0-SNAPSHOT</version>
10+
<relativePath>../pom.xml</relativePath>
11+
</parent>
12+
13+
<artifactId>lance-flink-1.18</artifactId>
14+
<name>Lance Flink Connector - Flink 1.18</name>
15+
<description>Lance Flink Connector for Apache Flink 1.18</description>
16+
<packaging>jar</packaging>
17+
18+
<properties>
19+
<flink.version>${flink118.version}</flink.version>
20+
</properties>
21+
22+
<dependencies>
23+
<!-- Lance 依赖 -->
24+
<dependency>
25+
<groupId>com.lancedb</groupId>
26+
<artifactId>lance-core</artifactId>
27+
</dependency>
28+
29+
<!-- Arrow -->
30+
<dependency>
31+
<groupId>org.apache.arrow</groupId>
32+
<artifactId>arrow-vector</artifactId>
33+
</dependency>
34+
35+
<dependency>
36+
<groupId>org.apache.arrow</groupId>
37+
<artifactId>arrow-memory-netty</artifactId>
38+
</dependency>
39+
40+
<dependency>
41+
<groupId>org.apache.arrow</groupId>
42+
<artifactId>arrow-c-data</artifactId>
43+
</dependency>
44+
45+
<!-- Flink 1.18 -->
46+
<dependency>
47+
<groupId>org.apache.flink</groupId>
48+
<artifactId>flink-streaming-java</artifactId>
49+
</dependency>
50+
51+
<dependency>
52+
<groupId>org.apache.flink</groupId>
53+
<artifactId>flink-table-api-java</artifactId>
54+
</dependency>
55+
56+
<dependency>
57+
<groupId>org.apache.flink</groupId>
58+
<artifactId>flink-table-api-java-bridge</artifactId>
59+
</dependency>
60+
61+
<dependency>
62+
<groupId>org.apache.flink</groupId>
63+
<artifactId>flink-table-common</artifactId>
64+
</dependency>
65+
66+
<dependency>
67+
<groupId>org.apache.flink</groupId>
68+
<artifactId>flink-connector-base</artifactId>
69+
</dependency>
70+
71+
<!-- 日志 -->
72+
<dependency>
73+
<groupId>org.slf4j</groupId>
74+
<artifactId>slf4j-api</artifactId>
75+
</dependency>
76+
77+
<!-- 测试依赖 -->
78+
<dependency>
79+
<groupId>org.junit.jupiter</groupId>
80+
<artifactId>junit-jupiter-api</artifactId>
81+
</dependency>
82+
83+
<dependency>
84+
<groupId>org.junit.jupiter</groupId>
85+
<artifactId>junit-jupiter-engine</artifactId>
86+
</dependency>
87+
88+
<dependency>
89+
<groupId>org.junit.jupiter</groupId>
90+
<artifactId>junit-jupiter-params</artifactId>
91+
</dependency>
92+
93+
<dependency>
94+
<groupId>org.apache.flink</groupId>
95+
<artifactId>flink-test-utils</artifactId>
96+
</dependency>
97+
98+
<dependency>
99+
<groupId>org.apache.flink</groupId>
100+
<artifactId>flink-runtime</artifactId>
101+
<type>test-jar</type>
102+
</dependency>
103+
104+
<dependency>
105+
<groupId>org.apache.flink</groupId>
106+
<artifactId>flink-streaming-java</artifactId>
107+
<type>test-jar</type>
108+
</dependency>
109+
110+
<dependency>
111+
<groupId>org.apache.flink</groupId>
112+
<artifactId>flink-table-planner_2.12</artifactId>
113+
</dependency>
114+
115+
<dependency>
116+
<groupId>org.mockito</groupId>
117+
<artifactId>mockito-core</artifactId>
118+
</dependency>
119+
120+
<dependency>
121+
<groupId>org.mockito</groupId>
122+
<artifactId>mockito-junit-jupiter</artifactId>
123+
</dependency>
124+
125+
<dependency>
126+
<groupId>org.assertj</groupId>
127+
<artifactId>assertj-core</artifactId>
128+
</dependency>
129+
130+
<dependency>
131+
<groupId>org.apache.logging.log4j</groupId>
132+
<artifactId>log4j-slf4j-impl</artifactId>
133+
</dependency>
134+
135+
<dependency>
136+
<groupId>org.apache.logging.log4j</groupId>
137+
<artifactId>log4j-api</artifactId>
138+
</dependency>
139+
140+
<dependency>
141+
<groupId>org.apache.logging.log4j</groupId>
142+
<artifactId>log4j-core</artifactId>
143+
</dependency>
144+
145+
<dependency>
146+
<groupId>org.apache.flink</groupId>
147+
<artifactId>flink-clients</artifactId>
148+
</dependency>
149+
</dependencies>
150+
151+
<build>
152+
<plugins>
153+
<!-- 引用共享源码 -->
154+
<plugin>
155+
<groupId>org.codehaus.mojo</groupId>
156+
<artifactId>build-helper-maven-plugin</artifactId>
157+
<executions>
158+
<execution>
159+
<id>add-source</id>
160+
<phase>generate-sources</phase>
161+
<goals>
162+
<goal>add-source</goal>
163+
</goals>
164+
<configuration>
165+
<sources>
166+
<source>${project.basedir}/../src/main/java</source>
167+
</sources>
168+
</configuration>
169+
</execution>
170+
<execution>
171+
<id>add-test-source</id>
172+
<phase>generate-test-sources</phase>
173+
<goals>
174+
<goal>add-test-source</goal>
175+
</goals>
176+
<configuration>
177+
<sources>
178+
<source>${project.basedir}/../src/test/java</source>
179+
</sources>
180+
</configuration>
181+
</execution>
182+
<execution>
183+
<id>add-resource</id>
184+
<phase>generate-resources</phase>
185+
<goals>
186+
<goal>add-resource</goal>
187+
</goals>
188+
<configuration>
189+
<resources>
190+
<resource>
191+
<directory>${project.basedir}/../src/main/resources</directory>
192+
</resource>
193+
</resources>
194+
</configuration>
195+
</execution>
196+
<execution>
197+
<id>add-test-resource</id>
198+
<phase>generate-test-resources</phase>
199+
<goals>
200+
<goal>add-test-resource</goal>
201+
</goals>
202+
<configuration>
203+
<resources>
204+
<resource>
205+
<directory>${project.basedir}/../src/test/resources</directory>
206+
</resource>
207+
</resources>
208+
</configuration>
209+
</execution>
210+
</executions>
211+
</plugin>
212+
213+
<plugin>
214+
<groupId>org.apache.maven.plugins</groupId>
215+
<artifactId>maven-shade-plugin</artifactId>
216+
</plugin>
217+
218+
<plugin>
219+
<groupId>org.apache.maven.plugins</groupId>
220+
<artifactId>maven-jar-plugin</artifactId>
221+
</plugin>
222+
223+
<plugin>
224+
<groupId>org.apache.maven.plugins</groupId>
225+
<artifactId>maven-source-plugin</artifactId>
226+
</plugin>
227+
228+
<plugin>
229+
<groupId>org.jacoco</groupId>
230+
<artifactId>jacoco-maven-plugin</artifactId>
231+
</plugin>
232+
</plugins>
233+
</build>
234+
</project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Configuration status="WARN">
3+
<Appenders>
4+
<Console name="Console" target="SYSTEM_OUT">
5+
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
6+
</Console>
7+
</Appenders>
8+
<Loggers>
9+
<Logger name="org.apache.flink.connector.lance" level="DEBUG"/>
10+
<Logger name="org.apache.flink" level="INFO"/>
11+
<Root level="INFO">
12+
<AppenderRef ref="Console"/>
13+
</Root>
14+
</Loggers>
15+
</Configuration>

0 commit comments

Comments
 (0)