Skip to content

Commit

Permalink
Add http(s) support to the command line
Browse files Browse the repository at this point in the history
  • Loading branch information
kcolford committed Jan 4, 2024
1 parent 819d357 commit b26dfce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion datafusion-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dirs = "4.0.0"
env_logger = "0.9"
futures = "0.3"
mimalloc = { version = "0.1", default-features = false }
object_store = { version = "0.8.0", features = ["aws", "gcp"] }
object_store = { version = "0.8.0", features = ["aws", "gcp", "http"] }
parking_lot = { version = "0.12" }
parquet = { version = "49.0.0", default-features = false }
regex = "1.8"
Expand Down
4 changes: 4 additions & 0 deletions datafusion-cli/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use datafusion::prelude::SessionContext;
use datafusion::sql::{parser::DFParser, sqlparser::dialect::dialect_from_str};

use object_store::ObjectStore;
use object_store::http::HttpBuilder;
use rustyline::error::ReadlineError;
use rustyline::Editor;
use tokio::signal;
Expand Down Expand Up @@ -278,6 +279,9 @@ async fn create_external_table(
let builder = get_gcs_object_store_builder(url, cmd)?;
Arc::new(builder.build()?) as Arc<dyn ObjectStore>
}
"http" | "https" => {
Arc::new(HttpBuilder::new().with_url(url.origin().ascii_serialization()).build()?) as Arc<dyn ObjectStore>
}
_ => {
// for other types, try to get from the object_store_registry
ctx.runtime_env()
Expand Down

0 comments on commit b26dfce

Please sign in to comment.