Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,26 @@ jobs:
- name: Check datafusion-proto (avro)
run: cargo check --profile ci --no-default-features -p datafusion-proto --features=avro

# Check datafusion-ffi features
#
# Ensure via `cargo check` that the crate can be built with a
# subset of the features packages enabled.
linux-datafusion-ffi-features:
name: cargo check datafusion-ffi features
needs: linux-build-lib
runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }}
container:
image: amd64/rust
steps:
- uses: runs-on/action@d141ef83eb66d096ce8afc767e09115a65c63b60 # v2.1.2
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Check datafusion-ffi (no-default-features)
run: cargo check --profile ci --no-default-features -p datafusion-ffi


# Check datafusion crate features
#
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ datafusion-physical-expr-adapter = { path = "datafusion/physical-expr-adapter",
datafusion-physical-expr-common = { path = "datafusion/physical-expr-common", version = "54.0.0", default-features = false }
datafusion-physical-optimizer = { path = "datafusion/physical-optimizer", version = "54.0.0" }
datafusion-physical-plan = { path = "datafusion/physical-plan", version = "54.0.0" }
datafusion-proto = { path = "datafusion/proto", version = "54.0.0" }
datafusion-proto = { path = "datafusion/proto", version = "54.0.0", default-features = false }
Comment thread
Xuanwo marked this conversation as resolved.
datafusion-proto-common = { path = "datafusion/proto-common", version = "54.0.0" }
datafusion-proto-models = { path = "datafusion/proto-models", version = "54.0.0" }
datafusion-pruning = { path = "datafusion/pruning", version = "54.0.0" }
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ tokio = { workspace = true, features = ["rt-multi-thread", "parking_lot"] }
tokio-util = { version = "0.7.17" }

[dev-dependencies]
datafusion-proto = { workspace = true }
datafusion-proto = { workspace = true, features = ["parquet"] }
tempfile = { workspace = true }

[[bench]]
Expand Down
2 changes: 1 addition & 1 deletion datafusion-examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dashmap = { workspace = true }
base64 = "0.22.1"
datafusion-expr = { workspace = true }
datafusion-physical-expr-adapter = { workspace = true }
datafusion-proto = { workspace = true }
datafusion-proto = { workspace = true, features = ["parquet"] }
datafusion-sql = { workspace = true }
env_logger = { workspace = true }
futures = { workspace = true }
Expand Down
4 changes: 3 additions & 1 deletion datafusion/ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ datafusion-physical-expr = { workspace = true }
datafusion-physical-expr-common = { workspace = true }
datafusion-physical-optimizer = { workspace = true }
datafusion-physical-plan = { workspace = true }
datafusion-proto = { workspace = true }
datafusion-proto = { workspace = true, default-features = false }
datafusion-proto-common = { workspace = true }
datafusion-session = { workspace = true }
futures = { workspace = true }
Expand All @@ -83,10 +83,12 @@ datafusion-functions-window = { workspace = true }
doc-comment = { workspace = true }

[features]
default = ["parquet"]
integration-tests = [
"datafusion-functions",
"datafusion-functions-aggregate",
"datafusion-functions-table",
"datafusion-functions-window",
]
parquet = ["datafusion-proto/parquet"]
tarpaulin_include = [] # Exists only to prevent warnings on stable and still have accurate coverage
10 changes: 8 additions & 2 deletions datafusion/ffi/src/session/mod.rs
Comment thread
Xuanwo marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ fn table_options_to_rhash(mut options: TableOptions) -> SVec<(SString, SString)>
"datafusion_ffi.table_current_format".into(),
match current_format {
ConfigFileType::JSON => "json",
#[cfg(feature = "parquet")]
ConfigFileType::PARQUET => "parquet",
ConfigFileType::CSV => "csv",
}
Expand Down Expand Up @@ -476,13 +477,15 @@ fn table_options_from_rhashmap(options: SVec<(SString, SString)>) -> TableOption
let formats = [
ConfigFileType::CSV,
ConfigFileType::JSON,
#[cfg(feature = "parquet")]
ConfigFileType::PARQUET,
];
for format in formats {
// It is imperative that if new enum variants are added below that they be
// included in the formats list above and in the extension check below.
let format_name = match &format {
ConfigFileType::CSV => "csv",
#[cfg(feature = "parquet")]
ConfigFileType::PARQUET => "parquet",
ConfigFileType::JSON => "json",
};
Expand All @@ -504,7 +507,6 @@ fn table_options_from_rhashmap(options: SVec<(SString, SString)>) -> TableOption
.unwrap_or_else(|err| log::warn!("Error parsing table options: {err}"));
}
}

let extension_options: HashMap<String, String> = options
.iter()
.filter_map(|(k, v)| {
Expand All @@ -525,6 +527,7 @@ fn table_options_from_rhashmap(options: SVec<(SString, SString)>) -> TableOption
table_options.current_format =
current_format.and_then(|format| match format.as_str() {
"csv" => Some(ConfigFileType::CSV),
#[cfg(feature = "parquet")]
"parquet" => Some(ConfigFileType::PARQUET),
"json" => Some(ConfigFileType::JSON),
_ => None,
Expand Down Expand Up @@ -661,7 +664,10 @@ mod tests {
let mut table_options = TableOptions::default();
table_options.csv.has_header = Some(true);
table_options.json.schema_infer_max_rec = Some(10);
table_options.parquet.global.coerce_int96 = Some("123456789".into());
#[cfg(feature = "parquet")]
{
table_options.parquet.global.coerce_int96 = Some("123456789".into());
}
table_options.current_format = Some(ConfigFileType::JSON);

let state = SessionStateBuilder::new_from_existing(ctx.state())
Expand Down
4 changes: 3 additions & 1 deletion datafusion/proto/src/logical_plan/file_formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
use std::sync::Arc;

use super::LogicalExtensionCodec;
use crate::convert::{FromProto, TryFromProto};
use crate::convert::FromProto;
#[cfg(feature = "parquet")]
use crate::convert::TryFromProto;
use crate::protobuf::{
CsvOptions as CsvOptionsProto, CsvQuoteStyle as CsvQuoteStyleProto,
JsonOptions as JsonOptionsProto,
Expand Down
Loading