feat: add multi-version Flink module structure (1.18/1.19/1.20)#48
feat: add multi-version Flink module structure (1.18/1.19/1.20)#48fightBoxing wants to merge 1 commit into
Conversation
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 lance-format#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 lance-format#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 lance-format#17 in favor of this clean slice.
|
There are significant changes in how Flink works with sinks starting from version 1.19 (SinkV2). Many classes from 1.18 are marked as deprecated and removed in Flink 2+. Maybe it would be good for the connector to support new Flink 1.19+ API and skip supporting Flink 1.18-. I already did some implementation of Lance Sink V2 in my repo |
|
Thanks @empathy87 for the pointer and for the prototype work — really nice that you already have a SinkV2 PoC running. 🙏 Two thoughts to keep things clean: On scope of this PR. #48 is intentionally narrow — it only restructures the build into a parent + per-version submodule layout that share the same On dropping 1.18. SinkV2 is actually available since Flink 1.15 (FLIP-191), so adopting SinkV2 wouldn't, by itself, force us to drop 1.18. The EOL argument also cuts both ways — 1.19 reached EOL in April 2025; only 1.20 is current LTS. If we want to trim the matrix on EOL grounds, that's a separate (and bigger) discussion worth its own issue, where we can also weigh existing user adoption. Could I suggest we open a dedicated issue ("Migrate sink to SinkV2 / revisit supported Flink versions") to track that thread? Happy to review your branch there in detail — it looks like a substantial body of work that deserves its own focused PR rather than being folded into the build-system change. |
|
@fightBoxing, that would be great! I will open the issue "Migrate to SinkV2". And will prepare MR for it. |
Summary
Convert the project to a multi-module Maven build supporting 3 actively-supported Flink versions: 1.18.1 / 1.19.1 / 1.20.0. All modules share one source tree under root
src/, so per-version forks of the source code are not needed.This is a clean re-slice of #17 — it drops the 4 PR #14 catalog commits (which will land via their own PR) and removes the originally-included
lance-flink-1.17module (rationale below).Closes #17.
Module Layout
Each submodule:
src/viabuild-helper-maven-plugin(add-source/add-test-source/add-resource/add-test-resource)flink.versionto its target (${flink118.version}/${flink119.version}/${flink120.version})dependencyManagementPlugin versions kept aligned with main (#39):
maven-compiler-plugin3.15.0maven-shade-plugin3.6.2maven-jar-plugin3.5.0maven-source-plugin3.4.0jacoco-maven-plugin0.8.14Why no
lance-flink-1.17?Originally this PR included a
lance-flink-1.17module. Local verification on JDK 8 surfaced two unrelated bugs inside Flink 1.17.x's bundled (shaded) Calcite, both of which preventTableEnvironmentcreation:MetadataDef.<init>:48— anasserton a generic-type bound that is always false under-ea(default for surefire), throwingAssertionError.CacheGeneratorUtil$CacheKeyStrategy$1.safeArgList:213—IllegalArgumentException: fromIndex(2) > toIndex(0), surfaces even with-eadisabled.Same source tree + same JDK on Flink 1.18 / 1.19 / 1.20 runs cleanly, confirming this is a Flink-side issue, not a connector issue.
Combined with Flink 1.17 reaching end-of-life on 2024-10, supporting it would require carrying workarounds for an upstream-broken planner on a no-longer-maintained branch. We chose to drop 1.17 to keep the matrix lean.
Verification (local, JDK 8 / Tencent Kona 8.0.14)
The single failure is
LanceReadOptimizationsTest$FilterPushDownTests.testInPredicatePushDown— a pre-existing main bug that reproduces identically across every Flink version, unrelated to this PR.Diff Summary
lance-flink-{1.18,1.19,1.20}/{pom.xml, src/test/resources/log4j2-test.xml}pom.xml(now parent pom)LanceDynamicTableSource.java(remove unusedTableSchemaimport)Out of scope (intentionally excluded from #17)