Repository navigation
fix: stop enabling DataFusion default features in iceberg-datafusion - #155
dragonknightk wants to merge 3 commits into
Conversation
Closes issue 136. ## Rationale for this change `iceberg-datafusion` depended on `datafusion` with its default features, which include `sql`, although the library never uses SQL. Cargo unifies features across a build, so every project that depends on `iceberg-datafusion` also gets `sql`. That breaks projects that build DataFusion without `sql`. With `sql` on, `DataFusionError` gains a `SQL` variant, so a `match` that lists every variant no longer compiles. ## What changes are included in this PR? The workspace now declares `datafusion` with `default-features = false`, and the library enables no extra features. The crates that need more ask for it themselves: - `iceberg-datafusion-test-tools` enables `sql` (its harness calls `SessionContext::sql`) and `parquet` (it uses the Parquet re-export). - The library enables `parquet` and `sql` for its own tests as a dev-dependency only, so they are not part of a downstream build. ## Are these changes tested? This only changes manifests, so there is no new test. `cargo test -p iceberg-datafusion` still passes. A small downstream crate (not part of this PR) builds `datafusion-common` without `sql` and matches every `DataFusionError` variant. Before this change it fails with a non-exhaustive match on `SQL`. After it, it compiles. `cargo tree -e normal,features -i datafusion-common -p iceberg-datafusion` no longer lists `sql`. ## Are there any user-facing changes? Yes. `iceberg-datafusion` no longer turns on any DataFusion default feature (`sql`, `parquet`, compression codecs, and so on) for downstream builds. A project that relied on it for one of them must enable that feature on its own `datafusion` dependency. Signed-off-by: dragonknightk <37928252+dragonknightk@users.noreply.github.com>
|
Quick AI pass, as I can see this merging --> You will need to rebase
Nit: the SqlToRel::external_table_to_plan doc link in table_provider/factory.rs:193 no longer resolves without sql. |
Signed-off-by: dragonknightk <37928252+dragonknightk@users.noreply.github.com>
Closes issue 136. ## Rationale for this change `iceberg-datafusion` depended on `datafusion` with its default features, which include `sql`, even though the library never uses SQL. Cargo unifies features across a build, so every downstream project depending on `iceberg-datafusion` also gets `sql`. That breaks projects that build DataFusion without `sql`. With `sql` on, `DataFusionError` gains a `SQL` variant, so an exhaustive `match` on `DataFusionError` fails to compile. Workspace-only CI commands (`--workspace`) do not catch regressions because workspace dev-dependencies and tooling crates turn `sql` back on via feature unification. ## What changes are included in this PR? - Disable DataFusion default features in the workspace declaration, leaving `iceberg-datafusion` with no extra DataFusion features. - Enable `parquet` and `sql` explicitly where directly used: `iceberg-datafusion-test-tools` (Parquet re-export and `SessionContext::sql` in the harness) and `iceberg-datafusion` dev-dependencies (tests only, excluded from downstream builds). `iceberg-sqllogictest` and `iceberg-playground` do not call `SessionContext::sql` directly and remain unchanged. - Add `cargo check --locked -p iceberg-datafusion --lib` to the existing CI Clippy job so future library changes that rely on DataFusion default features fail CI. - Change the `datafusion::sql::planner::SqlToRel::external_table_to_plan` doc reference in `factory.rs` from an intra-doc link to plain inline code, since `datafusion::sql` is absent without `sql`. ## Are these changes tested? - Library isolation: verified that `iceberg-datafusion --lib` compiles without DataFusion default features and that its normal dependency tree for `datafusion-common` no longer includes `sql`. - Documentation: verified strict rustdoc build for `iceberg-datafusion` passes with no unresolved intra-doc links in the modified code. - Workspace and downstream compatibility: full workspace tests and clippy pass; a downstream crate matching all non-`sql` `DataFusionError` variants fails with a non-exhaustive match on `SQL` before this PR and compiles after it. ## Are there any user-facing changes? Yes. `iceberg-datafusion` no longer enables any DataFusion default feature (`sql`, `parquet`, compression codecs, and so on) for downstream builds. A project relying on any of those features must enable it on its own `datafusion` dependency. Signed-off-by: dragonknightk <37928252+dragonknightk@users.noreply.github.com>
|
@NoahKusaba Thanks for taking a look! Merged I left |
There was a problem hiding this comment.
Looks good going to approve. One last suggestion that is nice to have.
Adding features = ["sql"] to the library makes the new cargo check step pass again, which brings back #136. Could CI also check that the library doesn't turn sql on? This fails on main and passes here:
test -z "$(cargo tree --locked -p iceberg-datafusion -e normal -i sqlparser)"SQL support could still come later as an opt-in sql feature of iceberg-datafusion.
Closes #136.
Rationale for this change
iceberg-datafusiondepended ondatafusionwith its default features, which includesql, even though the library never uses SQL. Cargo unifies features across a build, so every downstream project depending oniceberg-datafusionalso getssql.That breaks projects that build DataFusion without
sql. Withsqlon,DataFusionErrorgains aSQLvariant, so an exhaustivematchonDataFusionErrorfails to compile.Workspace-only CI commands (
--workspace) do not catch regressions because workspace dev-dependencies and tooling crates turnsqlback on via feature unification.What changes are included in this PR?
iceberg-datafusionwith no extra DataFusion features.parquetandsqlexplicitly where directly used:iceberg-datafusion-test-tools(Parquet re-export andSessionContext::sqlin the harness) andiceberg-datafusiondev-dependencies (tests only, excluded from downstream builds).iceberg-sqllogictestandiceberg-playgrounddo not callSessionContext::sqldirectly and remain unchanged.cargo check --locked -p iceberg-datafusion --libto the existing CI Clippy job so future library changes that rely on DataFusion default features fail CI.datafusion::sql::planner::SqlToRel::external_table_to_plandoc reference infactory.rsfrom an intra-doc link to plain inline code, sincedatafusion::sqlis absent withoutsql.Are these changes tested?
iceberg-datafusion --libcompiles without DataFusion default features and that its normal dependency tree fordatafusion-commonno longer includessql.iceberg-datafusionpasses with no unresolved intra-doc links in the modified code.sqlDataFusionErrorvariants fails with a non-exhaustive match onSQLbefore this PR and compiles after it.Are there any user-facing changes?
Yes.
iceberg-datafusionno longer enables any DataFusion default feature (sql,parquet, compression codecs, and so on) for downstream builds. A project relying on any of those features must enable it on its owndatafusiondependency.AI Disclosure
Grok Bot, working for dragonknightk, assisted with the changes, the description, and the verification. All content was reviewed by a human, and the submitter understands and can maintain these changes.