Skip to content

feat: Allow datafusion-ffi to opt out of proto parquet - #22951

Merged
timsaucer merged 4 commits into
apache:mainfrom
Xuanwo:xuanwo/datafusion-ffi-proto-parquet
Jul 6, 2026
Merged

feat: Allow datafusion-ffi to opt out of proto parquet#22951
timsaucer merged 4 commits into
apache:mainfrom
Xuanwo:xuanwo/datafusion-ffi-proto-parquet

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Jun 15, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

N/A

Rationale for this change

datafusion-ffi inherits datafusion-proto from the workspace. Because datafusion-proto enables its parquet feature by default, downstream crates that depend on datafusion-ffi also pull in datafusion-datasource-parquet, parquet, and parquet compression dependencies even when they do not need parquet-aware proto support.

Cargo features are additive, so downstream users cannot opt out by disabling default features on their own direct datafusion-proto dependency if the datafusion-ffi -> datafusion-proto edge has already enabled defaults.

What changes are included in this PR?

This PR makes the workspace datafusion-proto dependency default to default-features = false, then lets crates opt into the previous behavior explicitly.

For datafusion-ffi, the previous default behavior is preserved with a new default parquet feature. Downstream users that want to avoid parquet dependencies can now use datafusion-ffi with default-features = false.

The FFI session table option bridge now gates ConfigFileType::PARQUET usage behind the datafusion-ffi/parquet feature, while still preserving parquet table option values in no-default builds.

Are these changes tested?

Yes. Existing datafusion-ffi tests pass with default features and with --no-default-features. The feature graph was also checked to confirm that default datafusion-ffi still enables parquet, while datafusion-ffi --no-default-features does not include datafusion-datasource-parquet.

Are there any user-facing changes?

Default behavior is unchanged. Users can now opt out of parquet-aware proto support from datafusion-ffi by disabling datafusion-ffi default features.

@Xuanwo
Xuanwo marked this pull request as ready for review June 15, 2026 07:36
@github-actions github-actions Bot added proto Related to proto crate ffi Changes to the ffi crate labels Jun 15, 2026

@waynexia waynexia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good

@Xuanwo Xuanwo changed the title Allow datafusion-ffi to opt out of proto parquet feat: Allow datafusion-ffi to opt out of proto parquet Jun 15, 2026

@martin-g martin-g left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no new tests / CI jobs verifying that cargo check -p datafusion-ffi --no-default-features still builds.

Comment thread datafusion/ffi/src/session/mod.rs Outdated
Comment thread datafusion/ffi/src/session/mod.rs
Comment thread benchmarks/Cargo.toml Outdated
Comment thread datafusion-examples/Cargo.toml Outdated
Comment thread Cargo.toml
@github-actions github-actions Bot added the development-process Related to development process of DataFusion label Jun 16, 2026
@Xuanwo

Xuanwo commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

I added a CI check for this path:

cargo check --profile ci --no-default-features -p datafusion-ffi

cc @martin-g, please take another look, thank you!

@alamb

alamb commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@adriangb can you also maybe take a look at this PR in light of the work you are doing to refactor the proto

also cc @timsaucer

@timsaucer timsaucer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one issue I see and it may be on my misreading.

Comment thread datafusion/ffi/src/session/mod.rs Outdated
Comment on lines +512 to +520
#[cfg(not(feature = "parquet"))]
for (key, value) in options.iter().filter_map(|(k, v)| {
let (prefix, key) = k.split_once(".")?;
(prefix == "parquet").then(|| (key, v))
}) {
table_options.parquet.set(key, value).unwrap_or_else(|err| {
log::warn!("Error parsing parquet table option: {err}")
});
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I reading this wrong? It looks like this is gating backwards - this code block is enabled when we don't have the parquet feature, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I want to print some warnings while users passing parquet options but parquet didn't enabled. I'm open to just remove it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @timsaucer, any suggestions?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend removing this code snippet. I ran a test and when we do set valid parquet options the warning does not fire because table_options.parquet.set() passes. Plus there are a bunch of default table options for parquet that do pass as well and we cannot tell a priori if they're the default values or if the user has set the value. After all, a user could intentionally set a value to a default and the intent of this snippet would be to warn when setting these values.

In the end, maybe I'm being pedantic but I recommend just removing this bit.

@Xuanwo Xuanwo Jul 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @timsaucer. That makes sense. I have removed, PTAL.

@timsaucer
timsaucer added this pull request to the merge queue Jul 6, 2026
Merged via the queue into apache:main with commit 34200e4 Jul 6, 2026
37 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/datafusion-ffi-proto-parquet branch July 8, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

development-process Related to development process of DataFusion ffi Changes to the ffi crate proto Related to proto crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants