Skip to content

Commit

Permalink
chore: bump versions (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
timvw committed Mar 26, 2024
1 parent 63ccc02 commit d3e4bc6
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 39 deletions.
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ keywords = [ "quickview", "data", "query", "sql", "datafusion" ]

[dependencies]
aws-config = "0.55"
aws-sdk-glue = "0.28.0"
aws-sdk-glue = "0.28"
aws-types = "0.55"
chrono = "0.4.26"
clap = { version = "4.3.5", features = ["derive"] }
datafusion = { version = "25", features = ["avro"] }
deltalake = { version = "0.12.0", default-features = false, features = ["datafusion-ext", "s3"] }
chrono = "0.4"
clap = { version = "4.5", features = ["derive"] }
datafusion = { version = "36.0", features = ["avro"] }
#deltalake = { version = "0.12.0", default-features = false, features = ["datafusion-ext", "s3"] }
futures = "0.3"
glob = "0.3.1"
object_store = { version = "0.5.6", features = ["aws", "gcp", "aws_profile"] }
regex = "1.8"
tokio = { version = "1.28.2", features = ["macros", "rt", "rt-multi-thread", "sync", "parking_lot"] }
url = "2.4"
glob = "0.3"
object_store = { version = "0.9", features = ["aws", "gcp"] }
regex = "1.10"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "parking_lot"] }
url = "2.5"

[dev-dependencies]
assert_cmd = "2.0.11"
predicates = "3.0.3"
assert_cmd = "2.0"
predicates = "3.1"
39 changes: 22 additions & 17 deletions src/globbing_table.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
use crate::object_store_util::*;
use crate::GlobbingPath;
use chrono::{DateTime, Utc};
Expand All @@ -7,8 +8,8 @@ use datafusion::datasource::object_store::ObjectStoreUrl;
use datafusion::datasource::TableProvider;
use datafusion::error::DataFusionError;
use datafusion::prelude::SessionContext;
use deltalake::storage::DeltaObjectStore;
use deltalake::{DeltaTable, DeltaTableConfig};
//use deltalake::storage::DeltaObjectStore;
//use deltalake::{DeltaTable, DeltaTableConfig};
use object_store::path::Path;
use object_store::ObjectMeta;
use std::sync::Arc;
Expand All @@ -24,20 +25,24 @@ pub async fn build_table_provider(
maybe_at: &Option<DateTime<Utc>>,
) -> Result<Arc<dyn TableProvider>> {
let store = globbing_path.get_store(ctx)?;
let table_arc: Arc<dyn TableProvider> =
if has_delta_log_folder(&store, &globbing_path.prefix).await? {
let delta_table = load_delta_table(
ctx,
&globbing_path.object_store_url,
&globbing_path.prefix,
maybe_at,
)
.await?;
Arc::new(delta_table)
} else {
let listing_table = load_listing_table(ctx, globbing_path).await?;
Arc::new(listing_table)
};
let table_arc: Arc<dyn TableProvider> = {
let listing_table = load_listing_table(ctx, globbing_path).await?;
Arc::new(listing_table)
};
/*
if has_delta_log_folder(&store, &globbing_path.prefix).await? {
let delta_table = load_delta_table(
ctx,
&globbing_path.object_store_url,
&globbing_path.prefix,
maybe_at,
)
.await?;
Arc::new(delta_table)
} else {
let listing_table = load_listing_table(ctx, globbing_path).await?;
Arc::new(listing_table)
};*/
Ok(table_arc)
}
Expand Down Expand Up @@ -99,4 +104,4 @@ async fn load_delta_table(
delta_table_load_result
.map(|_| delta_table)
.map_err(|dte| DataFusionError::External(Box::new(dte)))
}
}*/
22 changes: 12 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::Parser;
use datafusion::catalog::TableReference;
//use datafusion::catalog::TableReference;

use datafusion::common::Result;
use datafusion::prelude::*;
Expand All @@ -11,21 +11,21 @@ mod object_store_util;

use crate::args::Args;
use crate::globbing_path::GlobbingPath;
use crate::globbing_table::build_table_provider;
use crate::object_store_util::register_object_store;
//use crate::globbing_table::build_table_provider;
//use crate::object_store_util::register_object_store;

#[tokio::main]
async fn main() -> Result<()> {
let config = SessionConfig::new().with_information_schema(true);
let ctx = SessionContext::with_config(config);

Check failure on line 20 in src/main.rs

View workflow job for this annotation

GitHub Actions / cargo clippy

use of deprecated associated function `datafusion::prelude::SessionContext::with_config`: Use SessionContext::new_with_config

Check failure on line 20 in src/main.rs

View workflow job for this annotation

GitHub Actions / cargo test

use of deprecated associated function `datafusion::prelude::SessionContext::with_config`: Use SessionContext::new_with_config

let args: Args = Args::parse();
let globbing_path = args.get_globbing_path().await?;
register_object_store(&ctx, &globbing_path.object_store_url).await?;
//let globbing_path = args.get_globbing_path().await?;
//register_object_store(&ctx, &globbing_path.object_store_url).await?;

let table_arc = build_table_provider(&ctx, &globbing_path, &args.at).await?;
let table_ref = TableReference::full("datafusion", "public", "tbl");
ctx.register_table(table_ref, table_arc)?;
//let table_arc = build_table_provider(&ctx, &globbing_path, &args.at).await?;
//let table_ref = TableReference::full("datafusion", "public", "tbl");
//ctx.register_table(table_ref, table_arc)?;

let query = &args.get_query();
let df = ctx.sql(query).await?;
Expand Down Expand Up @@ -61,6 +61,7 @@ mod tests {
Ok(())
}

/*
#[tokio::test]
async fn run_with_local_avro_file() -> Result<()> {
let mut cmd = get_qv_cmd()?;
Expand All @@ -69,13 +70,14 @@ mod tests {
.stdout(predicate::str::contains("| id | bool_col | tinyint_col | smallint_col | int_col | bigint_col | float_col | double_col | date_string_col | string_col | timestamp_col |"))
.stdout(predicate::str::contains("| 4 | true | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 30332f30312f3039 | 30 | 2009-03-01T00:00:00 |"));
Ok(())
}
}*/

fn get_qv_testing_path(rel_data_path: &str) -> String {

Check failure on line 75 in src/main.rs

View workflow job for this annotation

GitHub Actions / cargo test

function `get_qv_testing_path` is never used
let testing_path = env::var("QV_TESTING_PATH").unwrap_or_else(|_| "./testing".to_string());
format!("{}/{}", testing_path, rel_data_path)
}

/*
#[tokio::test]
async fn run_with_local_parquet_file() -> Result<()> {
let mut cmd = get_qv_cmd()?;
Expand All @@ -91,5 +93,5 @@ mod tests {
r#"| {reply_id: 332770973, next_id: } | -1473106667809783919 |"#,
));
Ok(())
}
}*/
}
2 changes: 2 additions & 0 deletions src/object_store_util.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
use datafusion::common::Result;
use datafusion::datasource::object_store::ObjectStoreUrl;
use datafusion::prelude::SessionContext;
Expand Down Expand Up @@ -153,3 +154,4 @@ mod tests {
Ok(())
}
}
*/

0 comments on commit d3e4bc6

Please sign in to comment.