Skip to content

Commit

Permalink
feat: read_blob (#2902)
Browse files Browse the repository at this point in the history
closes #2683
  • Loading branch information
universalmind303 authored and tychoish committed Apr 17, 2024
1 parent 1f5d400 commit dc53418
Show file tree
Hide file tree
Showing 19 changed files with 409 additions and 15 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ tempfile = "3.10.1"
thiserror = "1.0"
tracing = "0.1"
url = "2.5.0"
bytes = "1.6.0"

[workspace.dependencies.deltalake]
git = "https://github.com/GlareDB/delta-rs.git"
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ lzma-sys = { version = "*", features = ["static"] } # Prevent dynamic linking of
napi = { version = "2.16.2", default-features = false, features = ["full"] }
napi-derive = "2.16.2"
once_cell = "1.19.0"
bytes = "1.6.0"
bytes = { workspace = true }
async-once-cell = "0.5.3"

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/bytesutil/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = {workspace = true}
workspace = true

[dependencies]
bytes = "1.6.0"
bytes = { workspace = true }
2 changes: 1 addition & 1 deletion crates/datasources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async-stream = "0.3.5"
async-trait = { workspace = true }
bigquery-storage = { git = "https://github.com/glaredb/bigquery-storage", branch = "deps/2023-10-27-update" }
bitvec = "1"
bytes = "1.6.0"
bytes = { workspace = true }
chrono = { workspace = true }
chrono-tz = "0.8.6"
datafusion = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/ioutil/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ edition = {workspace = true}
workspace = true

[dependencies]
bytes = "1.6.0"
bytes = { workspace = true }
home = "0.5.9"
2 changes: 1 addition & 1 deletion crates/metastore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tokio = { workspace = true }
tonic = { workspace = true }
tracing = { workspace = true }
uuid = { version = "1.8.0", features = ["v4", "fast-rng", "macro-diagnostics"] }
bytes = "1.6"
bytes = { workspace = true }
once_cell = "1.19.0"
tower = "0.4"
dashmap = "5.5.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/object_store_util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ thiserror = { workspace = true }
tracing = { workspace = true }
tokio = { workspace = true }
tempfile = "3"
bytes = "1.6.0"
bytes = { workspace = true }
moka = { version = "0.12.5", features = ["future"] }
uuid = { version = "1.8.0", features = ["v4", "fast-rng", "macro-diagnostics"] }
2 changes: 1 addition & 1 deletion crates/pgprototest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ clap = { workspace = true }
anyhow = { workspace = true }
datadriven = "0.6.0"
postgres-protocol = "0.6.5"
bytes = "1.6.0"
bytes = { workspace = true }
fallible-iterator = "0.2.0"
2 changes: 1 addition & 1 deletion crates/pgrepr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ decimal = { path = "../decimal" }
num-traits = "0.2.18"
dtoa = "1.0.9"
chrono-tz = "0.8.6"
bytes = "1.6.0"
bytes = { workspace = true }
const_format = "0.2.32"
once_cell = "1.19.0"
2 changes: 1 addition & 1 deletion crates/pgsrv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bytesutil = { path = "../bytesutil" }
parser = { path = "../parser" }
pgrepr = { path = "../pgrepr" }
datafusion_ext = { path = "../datafusion_ext" }
bytes = "1.6.0"
bytes = { workspace = true }
rustls = "0.21.10"
webpki-roots = "0.26.1"
tokio-rustls = "0.24.1"
Expand Down
1 change: 1 addition & 0 deletions crates/sqlbuiltins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tracing = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true }
reqwest = { workspace = true }
bytes = { workspace = true }
async-openai = "0.20.0"
once_cell = "1.19.0"
num-traits = "0.2.18"
Expand Down
3 changes: 3 additions & 0 deletions crates/sqlbuiltins/src/functions/table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mod mysql;
mod object_store;
mod parquet_metadata;
mod postgres;
mod read_blob;
mod snowflake;

mod sqlite;
Expand Down Expand Up @@ -52,6 +53,7 @@ use self::mysql::ReadMysql;
use self::object_store::{CloudUpload, READ_CSV, READ_JSON, READ_PARQUET};
use self::parquet_metadata::ParquetMetadataFunc;
use self::postgres::ReadPostgres;
use self::read_blob::READ_BLOB;
use self::snowflake::ReadSnowflake;
use self::sqlite::ReadSqlite;
use self::sqlserver::ReadSqlServer;
Expand Down Expand Up @@ -101,6 +103,7 @@ impl BuiltinTableFuncs {
Arc::new(ReadSqlServer),
Arc::new(ReadCassandra),
// Object store
Arc::new(READ_BLOB),
Arc::new(READ_PARQUET),
Arc::new(READ_CSV),
Arc::new(READ_JSON),
Expand Down
10 changes: 5 additions & 5 deletions crates/sqlbuiltins/src/functions/table/object_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ impl WithCompression for ParquetFormat {
#[derive(Debug, Clone)]
pub struct ObjScanTableFunc<Opts> {
/// Primary name for the function.
name: &'static str,
pub(super) name: &'static str,

/// Additional aliases for this function.
aliases: &'static [&'static str],
pub(super) aliases: &'static [&'static str],

description: &'static str,
example: &'static str,
pub(super) description: &'static str,
pub(super) example: &'static str,

phantom: PhantomData<Opts>,
pub(super) phantom: PhantomData<Opts>,
}

impl<Opts: OptionReader> BuiltinFunction for ObjScanTableFunc<Opts> {
Expand Down
Loading

0 comments on commit dc53418

Please sign in to comment.