Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ Cargo.lock
/target

.idea
.DS_Store
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ keywords = ["arrow", "arrow-rs", "datafusion"]
rust-version = "1.80"

[dependencies]
arrow = "54"
arrow-schema = "54"
arrow = "55"
arrow-schema = "55"
async-trait = "0.1"
dashmap = "6"
datafusion = "46"
datafusion-common = "46"
datafusion-expr = "46"
datafusion-functions = "46"
datafusion-functions-aggregate = "46"
datafusion-optimizer = "46"
datafusion-physical-expr = "46"
datafusion-physical-plan = "46"
datafusion-sql = "46"
datafusion = "47"
datafusion-common = "47"
datafusion-expr = "47"
datafusion-functions = "47"
datafusion-functions-aggregate = "47"
datafusion-optimizer = "47"
datafusion-physical-expr = "47"
datafusion-physical-plan = "47"
datafusion-sql = "47"
futures = "0.3"
itertools = "0.14"
log = "0.4"
object_store = "0.11"
object_store = "0.12"
ordered-float = "5.0.0"

[dev-dependencies]
Expand Down
3 changes: 2 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ allow = [
"BSD-2-Clause",
"BSD-3-Clause",
"CC0-1.0",
"Unicode-3.0"
"Unicode-3.0",
"Zlib"
]
version = 2
10 changes: 3 additions & 7 deletions src/materialized/dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use datafusion_expr::{
col, lit, utils::split_conjunction, Expr, LogicalPlan, LogicalPlanBuilder, TableScan,
};
use datafusion_functions::string::expr_fn::{concat, concat_ws};
use datafusion_optimizer::{analyzer::expand_wildcard_rule::ExpandWildcardRule, AnalyzerRule};
use datafusion_sql::TableReference;
use itertools::{Either, Itertools};
use std::{collections::HashSet, sync::Arc};
Expand Down Expand Up @@ -111,14 +110,14 @@ impl TableFunctionImpl for FileDependenciesUdtf {
"mv_dependencies: table '{table_name} is not a materialized view. (Materialized TableProviders must be registered using register_materialized"),
))?;

Ok(Arc::new(ViewTable::try_new(
Ok(Arc::new(ViewTable::new(
mv_dependencies_plan(
mv,
self.row_metadata_registry.as_ref(),
&self.config_options,
)?,
None,
)?))
)))
}
}

Expand Down Expand Up @@ -216,7 +215,7 @@ impl TableFunctionImpl for StaleFilesUdtf {
])?
.build()?;

Ok(Arc::new(ViewTable::try_new(logical_plan, None)?))
Ok(Arc::new(ViewTable::new(logical_plan, None)))
}
}

Expand Down Expand Up @@ -250,9 +249,6 @@ pub fn mv_dependencies_plan(
.filter_map(|(i, f)| partition_cols.contains(f.name()).then_some(i))
.collect();

// First expand all wildcards
let plan = ExpandWildcardRule {}.analyze(plan, config_options)?;

let pruned_plan_with_source_files = if partition_cols.is_empty() {
get_source_files_all_partitions(
materialized_view,
Expand Down
2 changes: 1 addition & 1 deletion src/materialized/file_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ impl FileMetadataBuilder {
.append_value(format!("{store_url}{}", meta.location));
self.last_modified
.append_option(meta.last_modified.timestamp_nanos_opt());
self.size.append_value(meta.size as u64); // this is not lossy assuming we're on a 64-bit platform
self.size.append_value(meta.size); // this is not lossy assuming we're on a 64-bit platform
}

fn finish(mut self) -> Result<RecordBatch> {
Expand Down
9 changes: 5 additions & 4 deletions src/materialized/hive_partition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ use arrow_schema::DataType;

use datafusion_common::{DataFusionError, Result, ScalarValue};
use datafusion_expr::{
expr::ScalarFunction, ColumnarValue, Expr, ScalarUDF, ScalarUDFImpl, Signature, TypeSignature,
Volatility,
expr::ScalarFunction, ColumnarValue, Expr, ScalarFunctionArgs, ScalarUDF, ScalarUDFImpl,
Signature, TypeSignature, Volatility,
};

pub static HIVE_PARTITION_UDF_NAME: &str = "hive_partition";
Expand Down Expand Up @@ -101,7 +101,8 @@ impl ScalarUDFImpl for HivePartitionUdf {
Ok(DataType::Utf8)
}

fn invoke(&self, values: &[ColumnarValue]) -> Result<ColumnarValue> {
fn invoke_with_args(&self, args: ScalarFunctionArgs) -> Result<ColumnarValue> {
let values = args.args;
let null_if_missing = values
.get(2)
.map(|val| match val {
Expand All @@ -113,7 +114,7 @@ impl ScalarUDFImpl for HivePartitionUdf {
.transpose()?
.unwrap_or(false);

let arrays = ColumnarValue::values_to_arrays(values)?;
let arrays = ColumnarValue::values_to_arrays(&values)?;

let [file_paths, table_partition_columns]: [Option<&StringArray>; 2] =
[&arrays[0], &arrays[1]].map(|arg| arg.as_any().downcast_ref());
Expand Down
7 changes: 1 addition & 6 deletions src/rewrite/exploitation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,6 @@ impl UserDefinedLogicalNodeCore for OneOf {
write!(f, "OneOf")
}

fn from_template(&self, _exprs: &[datafusion::prelude::Expr], inputs: &[LogicalPlan]) -> Self {
Self {
branches: inputs.to_vec(),
}
}

fn with_exprs_and_inputs(
&self,
_exprs: Vec<datafusion::prelude::Expr>,
Expand Down Expand Up @@ -459,6 +453,7 @@ impl DisplayAs for OneOfExec {
)
)
}
DisplayFormatType::TreeRender => Ok(()),
}
}
}
Expand Down
Loading