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

Feat: Implement hf:// / "hugging face" integration in datafusion-cli #10792

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 9 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
4 changes: 4 additions & 0 deletions datafusion-cli/Cargo.lock

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

6 changes: 5 additions & 1 deletion datafusion-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ arrow = "51.0.0"
async-trait = "0.1.41"
aws-config = "0.55"
aws-credential-types = "0.55"
bytes = "1.0"
clap = { version = "3", features = ["derive", "cargo"] }
datafusion = { path = "../datafusion/core", version = "38.0.0", features = [
"avro",
Expand All @@ -48,17 +49,20 @@ datafusion = { path = "../datafusion/core", version = "38.0.0", features = [
dirs = "4.0.0"
env_logger = "0.9"
futures = "0.3"
http= "0.2.12"
mimalloc = { version = "0.1", default-features = false }
object_store = { version = "0.9.0", features = ["aws", "gcp", "http"] }
parking_lot = { version = "0.12" }
parquet = { version = "51.0.0", default-features = false }
regex = "1.8"
rustyline = "11.0"
serde = "1.0.117"
serde_json = "1.0.117"
tokio = { version = "1.24", features = ["macros", "rt", "rt-multi-thread", "sync", "parking_lot", "signal"] }
url = "2.2"

[dev-dependencies]
assert_cmd = "2.0"
ctor = "0.2.0"
predicates = "3.0"
rstest = "0.17"
rstest = "0.17"
4 changes: 4 additions & 0 deletions datafusion-cli/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use std::any::Any;
use std::sync::{Arc, Weak};

use crate::hf_store::HFOptions;
use crate::object_storage::{get_object_store, AwsOptions, GcpOptions};

use datafusion::catalog::schema::SchemaProvider;
Expand Down Expand Up @@ -183,6 +184,9 @@ impl SchemaProvider for DynamicFileSchemaProvider {
"gs" | "gcs" => {
state = state.add_table_options_extension(GcpOptions::default())
}
"hf" => {
state = state.add_table_options_extension(HFOptions::default());
}
_ => {}
};
let store = get_object_store(
Expand Down
Loading
Loading