Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature gate arrow-flight client #5683

Closed
Closed
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
15 changes: 11 additions & 4 deletions arrow-flight/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ prost = { version = "0.12.3", default-features = false, features = ["prost-deriv
# For Timestamp type
prost-types = { version = "0.12.3", default-features = false }
tokio = { version = "1.0", default-features = false, features = ["macros", "rt", "rt-multi-thread"] }
tonic = { version = "0.11.0", default-features = false, features = ["transport", "codegen", "prost"] }
tonic = { version = "0.11.0", default-features = false, features = ["codegen", "prost"] }

# CLI-related dependencies
anyhow = { version = "1.0", optional = true }
Expand All @@ -63,6 +63,7 @@ all-features = true
default = []
flight-sql-experimental = ["arrow-arith", "arrow-data", "arrow-ord", "arrow-row", "arrow-select", "arrow-string", "once_cell"]
tls = ["tonic/tls"]
client = ["tonic/transport"]

# Enable CLI tools
cli = ["anyhow", "arrow-cast/prettyprint", "clap", "tracing-log", "tracing-subscriber", "tonic/tls-webpki-roots"]
Expand All @@ -79,13 +80,19 @@ tower = "0.4.13"

[[example]]
name = "flight_sql_server"
required-features = ["flight-sql-experimental", "tls"]
required-features = ["client", "flight-sql-experimental", "tls"]

[[bin]]
name = "flight_sql_client"
required-features = ["cli", "flight-sql-experimental", "tls"]
required-features = ["client", "cli", "flight-sql-experimental", "tls"]

[[test]]
name = "flight_sql_client_cli"
path = "tests/flight_sql_client_cli.rs"
required-features = ["cli", "flight-sql-experimental", "tls"]
required-features = ["client", "cli", "flight-sql-experimental", "tls"]


[[test]]
name = "client"
path = "tests/client.rs"
required-features = ["client"]
1 change: 1 addition & 0 deletions arrow-flight/gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// protoc in unbuntu builder needs this option
.protoc_arg("--experimental_allow_proto3_optional")
.out_dir("src")
.client_mod_attribute("arrow.flight.protocol", "#[cfg(feature = \"client\")]")
.compile_with_config(prost_config(), &[proto_path], &[proto_dir])?;

// read file contents to string
Expand Down
1 change: 1 addition & 0 deletions arrow-flight/src/arrow.flight.protocol.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion arrow-flight/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pub mod flight_descriptor {
}

/// Low Level [tonic] [`FlightServiceClient`](gen::flight_service_client::FlightServiceClient).
#[cfg(feature = "client")]
pub mod flight_service_client {
use super::gen;
pub use gen::flight_service_client::FlightServiceClient;
Expand All @@ -76,8 +77,11 @@ pub mod flight_service_server {
pub use gen::flight_service_server::FlightServiceServer;
}

/// Mid Level [`FlightClient`]
/// Mid Level [`FlightClient`].
#[cfg(feature = "client")]
pub mod client;

#[cfg(feature = "client")]
pub use client::FlightClient;

/// Decoder to create [`RecordBatch`](arrow_array::RecordBatch) streams from [`FlightData`] streams.
Expand Down
2 changes: 1 addition & 1 deletion arrow-integration-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ logging = ["tracing-subscriber"]

[dependencies]
arrow = { path = "../arrow", default-features = false, features = ["test_utils", "ipc", "ipc_compression", "json", "ffi"] }
arrow-flight = { path = "../arrow-flight", default-features = false }
arrow-flight = { path = "../arrow-flight", default-features = false, features = ["client"] }
arrow-buffer = { path = "../arrow-buffer", default-features = false }
arrow-integration-test = { path = "../arrow-integration-test", default-features = false }
async-trait = { version = "0.1.41", default-features = false }
Expand Down
Loading