I’d go with option B. The Spark plugin only needs two small helpers, and the v1 REST paths are already part of the compatibility contract. I don’t think that warrants a new published module.
We’ve had both approaches on the table for a couple of weeks. Can we go ahead with #6084 and close the loop? On Mon, Nov 30, 2026 at 9:01 PM Dmitri Bourlatchkov via dev < [email protected]> wrote: > Hi Yufei, > > Thanks for clarifying your view of this matter by approving [6053]. > > However, it appears we still lack consensus on this thread. > > Let's consolidate our discussion here. From previous responses I see that > Option B [6084] is preferred by more people so far. > > Thanks, > Dmitri. > > [6053] https://github.com/apache/polaris/pull/6053 > > [6084] https://github.com/apache/polaris/pull/6084 > > On Fri, Nov 27, 2026 at 11:04 AM Dmitri Bourlatchkov <[email protected]> > wrote: > > > Hi Yufei, > > > > It looks like we have some divergence between GH discussions [1] and this > > thread. > > > > Let's consolidate here. From previous responses I see that Option B is > > more preferable. > > > > Would you mind (re-) sharing your rationale? > > > > Thanks, > > Dmitri, > > [1] https://github.com/apache/polaris/pull/6084#issuecomment-7184488509 > > > > On Fri, Nov 27, 2026 at 5:05 AM Jean-Baptiste Onofré <[email protected]> > > wrote: > > > >> Hi Alex, > >> > >> Thanks for the summary! That helps (at least for me :)). > >> > >> I'm +1 for option B. > >> > >> Introducing a new published module for just two small classes, > >> especially one with an undeclared compileOnly dependency on > >> iceberg-core in the published POM, adds more build/packaging > >> complexity than it's worth imho. Since the v1 REST paths are part of > >> the API contract and expected to remain stable, duplicating those two > >> classes in the Spark plugin is a pragmatic approach and clean > >> tradeoff. > >> > >> If we ever have a broader set of client-side classes to share in the > >> future, we can revisit a proper shared client module then. > >> > >> Regards > >> JB > >> > >> On Thu, Nov 26, 2026 at 12:16 PM Alex Dutra via dev > >> <[email protected]> wrote: > >> > > >> > Hi all, > >> > > >> > To move this forward, let's compare the approaches: > >> > > >> > Option A: new polaris-api-catalog-common module [6053] > >> > > >> > - Pro: no code duplication. > >> > - Con: the new module has a "hidden" (compileOnly) dependency to > >> iceberg-core. > >> > > >> > Option B: copy the classes into the Spark plugin [6084] > >> > > >> > - Pro: no new module. > >> > - Con: the code is duplicated (2 classes). > >> > > >> > My personal take: I would go with Option B [6084]. I think Dmitri and > >> > Ayush also prefer this option, while Yufei prefers Option A. > >> > > >> > What I dislike in Option A [6053] is that the published artifact hides > >> > the iceberg-core requirement. compileOnly dependencies aren't written > >> > into the published POM, nor into Gradle module metadata. As a > >> > consequence, the module dependency graph is effectively broken: > >> > someone importing that module in their code would see a compilation > >> > failure, unless they add iceberg-core manually, which would come as a > >> > surprise. There are ways to fix that, but it would involve a lot of > >> > Gradle plumbing, which I don't think is worth doing for so little > >> > code. Option B is just a lot easier. > >> > > >> > I'd appreciate your opinions so that you can decide which option to > >> pick. > >> > > >> > Thanks, > >> > Alex > >> > > >> > [6053]: https://github.com/apache/polaris/pull/6053 > >> > [6084]: https://github.com/apache/polaris/pull/6084 > >> > > >> > On Fri, Nov 13, 2026 at 8:21 PM Yufei Gu <[email protected]> > wrote: > >> > > > >> > > I don’t think the fact that the plugin can connect to any server > >> makes the > >> > > shared module pointless. It won’t guarantee runtime compatibility, > >> but it > >> > > does keep the plugin and server code aligned when they’re built from > >> the > >> > > same source. > >> > > > >> > > The only caveat of the new module is that polaris-api-catalog-common > >> would > >> > > not be self-contained. Any future consumer must also provide Iceberg > >> core. > >> > > It's already there now. AFAIK, there is no way to avoid the > dependency > >> > > unless Polaris creates its own classes for the following ones: > >> > > > >> > > import org.apache.iceberg.catalog.Namespace; > >> > > import org.apache.iceberg.catalog.TableIdentifier; > >> > > import org.apache.iceberg.rest.RESTCatalogProperties; > >> > > import org.apache.iceberg.rest.RESTUtil; > >> > > import org.apache.iceberg.rest.Endpoint; > >> > > > >> > > Do we plan to do so? > >> > > > >> > > Yufei > >> > > > >> > > > >> > > On Fri, Nov 13, 2026 at 10:40 AM Ayush Saxena <[email protected]> > >> wrote: > >> > > > >> > > > Hi Alex, all, > >> > > > > >> > > > Thanks for the write-up, and for putting both approaches up rather > >> > > > than arguing them in the abstract. > >> > > > > >> > > > My preference is #6084, though I recognise the module had support > >> > > > before Dmitri's point. What persuades me is that the shared > artifact > >> > > > does not buy the guarantee it looks like it buys: the plugin runs > >> > > > against whatever server it is pointed at, so sharing a JAR aligns > >> the > >> > > > constants with one particular build of Polaris rather than with > the > >> > > > server actually answering. If the paths have to be stable within > API > >> > > > v1 regardless, a local copy carries the same contract with less > >> > > > machinery — and the new module needing iceberg-core undercuts the > >> > > > "thin" part of the original idea. > >> > > > > >> > > > The real cost is divergence later, not correctness today: someone > >> > > > changes PolarisResourcePaths server-side and the Spark copy > quietly > >> > > > does not follow. Nothing in the build ties them together. The > Spark > >> > > > copy of PolarisResourcePaths already carries a "keep in sync with > >> the > >> > > > server" note; GenericTableEndpoints does not, and nothing on the > >> > > > polaris-core side points back. Worth making it bidirectional and > >> > > > naming the sibling class in each, so whoever edits one knows the > >> other > >> > > > exists. > >> > > > > >> > > > A CHANGELOG note is worth having either way, since the bundle no > >> > > > longer ships org.apache.polaris.core.* at all — that is visible to > >> > > > anyone who was relying on those classes being present. > >> > > > > >> > > > -Ayush > >> > > > > >> > > > > >> > > > -Ayush > >> > > > > >> > > > On Fri, 13 Nov 2026 at 21:45, Alex Dutra via dev < > >> [email protected]> > >> > > > wrote: > >> > > > > > >> > > > > Hi Dmitri, > >> > > > > > >> > > > > You are right that creating a module just for reusing API URI > >> paths > >> > > > > looks overkill, especially given that the new module needs > >> > > > > iceberg-core, and thus is not a "lightweight" module. > >> > > > > > >> > > > > I created an alternative PR without the separate module (but > with > >> a > >> > > > > bit of code duplication instead): > >> > > > > > >> > > > > https://github.com/apache/polaris/pull/6053 : separate module > >> > > > > https://github.com/apache/polaris/pull/6084 : no separate > module > >> > > > > > >> > > > > Which one does the community prefer? > >> > > > > > >> > > > > Thanks, > >> > > > > Alex > >> > > > > > >> > > > > On Wed, Nov 11, 2026 at 5:59 PM Dmitri Bourlatchkov via dev > >> > > > > <[email protected]> wrote: > >> > > > > > > >> > > > > > Hi Alex, > >> > > > > > > >> > > > > > Sorry for coming late to this discussion. > >> > > > > > > >> > > > > > I left some comments in GH. However, I would not mind if PR > >> 6053 got > >> > > > merged > >> > > > > > "as is". I think it is still a net positive change. > >> > > > > > > >> > > > > > More specifically (repeating my points from GH), I do not see > >> much > >> > > > value in > >> > > > > > reusing API URI paths across independent runtime artifacts. > >> > > > > > > >> > > > > > The Spark Plugin may run against any server in practice. > Reusing > >> > > > Polaris > >> > > > > > modules does not guarantee that paths are aligned. > >> > > > > > > >> > > > > > On the other hand, API paths are expected to remain the same > >> within > >> > > > the API > >> > > > > > major version (v1), so copying constants will not add > >> maintenance > >> > > > overhead. > >> > > > > > > >> > > > > > Cheers, > >> > > > > > Dmitri. > >> > > > > > > >> > > > > > On Wed, Nov 11, 2026 at 4:10 AM Alex Dutra via dev < > >> > > > [email protected]> > >> > > > > > wrote: > >> > > > > > > >> > > > > > > And there it is: > >> > > > > > > > >> > > > > > > https://github.com/apache/polaris/pull/6053 > >> > > > > > > > >> > > > > > > Thanks, > >> > > > > > > Alex > >> > > > > > > > >> > > > > > > On Wed, Nov 11, 2026 at 9:26 AM Alex Dutra < > [email protected] > >> > > >> > > > wrote: > >> > > > > > > > > >> > > > > > > > Hi Yufei, > >> > > > > > > > > >> > > > > > > > Thanks, that's very helpful. Since it's just 2 classes, I > >> think it > >> > > > > > > > makes sense to favor option 2. I will open a PR shortly. > >> > > > > > > > > >> > > > > > > > Thanks, > >> > > > > > > > Alex > >> > > > > > > > > >> > > > > > > > On Tue, Nov 10, 2026 at 6:38 PM Yufei Gu < > >> [email protected]> > >> > > > wrote: > >> > > > > > > > > > >> > > > > > > > > Hi Alex, > >> > > > > > > > > > >> > > > > > > > > The Spark client uses only two classes from > polaris-core: > >> > > > > > > GenericTableEndpoints and PolarisResourcePaths. > >> > > > > > > > > > >> > > > > > > > > I'd favor option 2: move them into a small > >> > > > polaris-api-catalog-common > >> > > > > > > module under the dir "api", with explicit dependencies. Both > >> Spark > >> > > > and the > >> > > > > > > server could use it, and Spark would no longer depend on > core. > >> > > > > > > > > > >> > > > > > > > > Yufei > >> > > > > > > > > > >> > > > > > > > > > >> > > > > > > > > Yufei > >> > > > > > > > > > >> > > > > > > > > > >> > > > > > > > > On Tue, Nov 10, 2026 at 8:30 AM Alex Dutra via dev < > >> > > > > > > [email protected]> wrote: > >> > > > > > > > >> > >> > > > > > > > >> Hi all, > >> > > > > > > > >> > >> > > > > > > > >> While verifying the 1.9.0-rc0 vote I found a few > LICENSE > >> issues > >> > > > in > >> > > > > > > the Spark > >> > > > > > > > >> bundle JARs, which I'm fixing separately. Tracing one > of > >> them > >> > > > raised > >> > > > > > > a broader > >> > > > > > > > >> question that I'd like to discuss here. > >> > > > > > > > >> > >> > > > > > > > >> Background: > >> > > > > > > > >> > >> > > > > > > > >> The Spark plugin includes polaris-core as: > >> > > > > > > > >> > >> > > > > > > > >> implementation(project(":polaris-core")) { > >> isTransitive = > >> > > > false } > >> > > > > > > > >> > >> > > > > > > > >> See [1] for example. This was introduced in #1933 to > >> "avoid > >> > > > pulling > >> > > > > > > > >> unused dependencies". The bundle JAR then contains all > >> > > > polaris-core > >> > > > > > > classes > >> > > > > > > > >> but none of their runtime dependencies. There is a TODO > >> next to > >> > > > the > >> > > > > > > > >> line about extracting a thin "polaris-rest" module for > >> clients. > >> > > > > > > > >> > >> > > > > > > > >> What I observed: > >> > > > > > > > >> > >> > > > > > > > >> Running jdeps on the bundled org.apache.polaris.core > >> classes > >> > > > shows > >> > > > > > > references to > >> > > > > > > > >> packages that are not in the bundle, e.g. Jackson 3 > >> > > > > > > (tools.jackson.*), Guava, > >> > > > > > > > >> Immutables, the AWS/Azure/GCP SDKs, and > >> > > > > > > org.apache.polaris.core.admin.model > >> > > > > > > > >> (0 classes in the bundle, ~100 references to it). Spark > >> > > > provides some > >> > > > > > > of these > >> > > > > > > > >> at runtime (Jackson 2 annotations, SLF4J), but not > >> Jackson 3 or > >> > > > the > >> > > > > > > cloud SDKs. > >> > > > > > > > >> > >> > > > > > > > >> I have NOT determined which of these classes the Spark > >> client > >> > > > > > > actually loads at > >> > > > > > > > >> runtime, so this may be harmless today. But it means > the > >> > > > bundle's > >> > > > > > > correctness > >> > > > > > > > >> depends on the client never touching a class whose > >> dependency is > >> > > > > > > missing, and > >> > > > > > > > >> nothing in the build enforces that. > >> > > > > > > > >> > >> > > > > > > > >> Why not just drop isTransitive = false? > >> > > > > > > > >> > >> > > > > > > > >> polaris-core's runtime classpath resolves to ~300 > >> modules. > >> > > > Bundling > >> > > > > > > them all > >> > > > > > > > >> would make the JAR much larger, risk conflicts with > >> Spark's own > >> > > > > > > Jackson/Guava/ > >> > > > > > > > >> Netty, and require a full review of the bundle > >> LICENSE/NOTICE. > >> > > > > > > > >> > >> > > > > > > > >> Here are our options: > >> > > > > > > > >> > >> > > > > > > > >> 1. Keep as is, and document/test the supported surface > >> (e.g. an > >> > > > > > > integration > >> > > > > > > > >> test that loads every polaris-core class the client > >> uses > >> > > > from the > >> > > > > > > bundle). > >> > > > > > > > >> 2. Extract a thin client-facing module (the existing > >> TODO) > >> > > > containing > >> > > > > > > only what > >> > > > > > > > >> the Spark client needs, with its own explicit > >> dependencies, > >> > > > and > >> > > > > > > bundle that. > >> > > > > > > > >> 3. Drop isTransitive = false and handle conflicts via > >> > > > > > > relocation/exclusions, > >> > > > > > > > >> re-auditing LICENSE/NOTICE. > >> > > > > > > > >> > >> > > > > > > > >> What are your thoughts? In particular, if anyone knows > >> which > >> > > > > > > polaris-core > >> > > > > > > > >> classes the Spark client loads at runtime, that would > >> help > >> > > > scope this. > >> > > > > > > > >> > >> > > > > > > > >> Thanks, > >> > > > > > > > >> Alex > >> > > > > > > > >> > >> > > > > > > > >> [1]: > >> > > > > > > > >> > > > > >> > https://github.com/apache/polaris/blob/65befed8407eb8e6a1a5bb0d1a242fcdf5e82c2d/plugins/spark/v3.5/spark/build.gradle.kts#L55-L57 > >> > > > > > > > >> > > > > >> > > >
