Skip to content

Commit 98e9b82

Browse files
committed
Generic FlightTableFactory with a default FlightSqlDriver
1 parent 482ef45 commit 98e9b82

File tree

16 files changed

+1926
-10
lines changed

16 files changed

+1926
-10
lines changed

datafusion-cli/Cargo.lock

Lines changed: 203 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion-cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ datafusion = { path = "../datafusion/core", version = "41.0.0", features = [
4444
"regex_expressions",
4545
"unicode_expressions",
4646
"compression",
47+
"flight",
4748
] }
4849
dirs = "4.0.0"
4950
env_logger = "0.9"

datafusion-cli/src/exec.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ use datafusion::physical_plan::{collect, execute_stream, ExecutionPlanProperties
4242
use datafusion::sql::parser::{DFParser, Statement};
4343
use datafusion::sql::sqlparser::dialect::dialect_from_str;
4444

45+
use datafusion::datasource::flight::config::FlightOptions;
4546
use datafusion::sql::sqlparser;
4647
use rustyline::error::ReadlineError;
4748
use rustyline::Editor;
@@ -386,6 +387,8 @@ pub(crate) async fn register_object_store_and_config_extensions(
386387
let mut table_options = ctx.session_state().default_table_options().clone();
387388
if let Some(format) = format {
388389
table_options.set_config_format(format);
390+
} else {
391+
table_options.extensions.insert(FlightOptions::default())
389392
}
390393
table_options.alter_with_string_hash_map(options)?;
391394

datafusion/core/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ default = [
5959
"unicode_expressions",
6060
"compression",
6161
"parquet",
62+
"flight",
6263
]
6364
encoding_expressions = ["datafusion-functions/encoding_expressions"]
6465
# Used for testing ONLY: causes all values to hash to the same value (test for collisions)
6566
force_hash_collisions = ["datafusion-physical-plan/force_hash_collisions", "datafusion-common/force_hash_collisions"]
67+
flight = ["dep:arrow-flight", "dep:base64", "dep:prost", "dep:tonic"]
6668
math_expressions = ["datafusion-functions/math_expressions"]
6769
parquet = ["datafusion-common/parquet", "dep:parquet"]
6870
pyarrow = ["datafusion-common/pyarrow", "parquet"]
@@ -83,6 +85,7 @@ ahash = { workspace = true }
8385
apache-avro = { version = "0.16", optional = true }
8486
arrow = { workspace = true }
8587
arrow-array = { workspace = true }
88+
arrow-flight = { workspace = true, optional = true }
8689
arrow-ipc = { workspace = true }
8790
arrow-schema = { workspace = true }
8891
async-compression = { version = "0.4.0", features = [
@@ -94,6 +97,7 @@ async-compression = { version = "0.4.0", features = [
9497
"tokio",
9598
], optional = true }
9699
async-trait = { workspace = true }
100+
base64 = { version = "0.22", optional = true }
97101
bytes = { workspace = true }
98102
bzip2 = { version = "0.4.3", optional = true }
99103
chrono = { workspace = true }
@@ -128,11 +132,13 @@ parking_lot = { workspace = true }
128132
parquet = { workspace = true, optional = true, default-features = true }
129133
paste = "1.0.15"
130134
pin-project-lite = "^0.2.7"
135+
prost = { version = "0.12", optional = true }
131136
rand = { workspace = true }
132137
sqlparser = { workspace = true }
133138
tempfile = { workspace = true }
134139
tokio = { workspace = true }
135140
tokio-util = { version = "0.7.4", features = ["io"], optional = true }
141+
tonic = { version = "0.11", optional = true }
136142
url = { workspace = true }
137143
uuid = { version = "1.7", features = ["v4"] }
138144
xz2 = { version = "0.1", optional = true, features = ["static"] }
@@ -161,6 +167,7 @@ test-utils = { path = "../../test-utils" }
161167
thiserror = { workspace = true }
162168
tokio = { workspace = true, features = ["rt-multi-thread", "parking_lot", "fs"] }
163169
tokio-postgres = "0.7.7"
170+
tokio-stream = { version = "0.1.15", features = ["net"] }
164171

165172
[target.'cfg(not(target_os = "windows"))'.dev-dependencies]
166173
nix = { version = "0.29.0", features = ["fs"] }

0 commit comments

Comments
 (0)