Skip to content

Commit b88a762

Browse files
authored
Upgrade df47 (#55)
1 parent 7c1861e commit b88a762

File tree

7 files changed

+25
-31
lines changed

7 files changed

+25
-31
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ Cargo.lock
2525
/target
2626

2727
.idea
28+
.DS_Store

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,23 @@ keywords = ["arrow", "arrow-rs", "datafusion"]
2828
rust-version = "1.80"
2929

3030
[dependencies]
31-
arrow = "54"
32-
arrow-schema = "54"
31+
arrow = "55"
32+
arrow-schema = "55"
3333
async-trait = "0.1"
3434
dashmap = "6"
35-
datafusion = "46"
36-
datafusion-common = "46"
37-
datafusion-expr = "46"
38-
datafusion-functions = "46"
39-
datafusion-functions-aggregate = "46"
40-
datafusion-optimizer = "46"
41-
datafusion-physical-expr = "46"
42-
datafusion-physical-plan = "46"
43-
datafusion-sql = "46"
35+
datafusion = "47"
36+
datafusion-common = "47"
37+
datafusion-expr = "47"
38+
datafusion-functions = "47"
39+
datafusion-functions-aggregate = "47"
40+
datafusion-optimizer = "47"
41+
datafusion-physical-expr = "47"
42+
datafusion-physical-plan = "47"
43+
datafusion-sql = "47"
4444
futures = "0.3"
4545
itertools = "0.14"
4646
log = "0.4"
47-
object_store = "0.11"
47+
object_store = "0.12"
4848
ordered-float = "5.0.0"
4949

5050
[dev-dependencies]

deny.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ allow = [
2323
"BSD-2-Clause",
2424
"BSD-3-Clause",
2525
"CC0-1.0",
26-
"Unicode-3.0"
26+
"Unicode-3.0",
27+
"Zlib"
2728
]
2829
version = 2

src/materialized/dependencies.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ use datafusion_expr::{
3131
col, lit, utils::split_conjunction, Expr, LogicalPlan, LogicalPlanBuilder, TableScan,
3232
};
3333
use datafusion_functions::string::expr_fn::{concat, concat_ws};
34-
use datafusion_optimizer::{analyzer::expand_wildcard_rule::ExpandWildcardRule, AnalyzerRule};
3534
use datafusion_sql::TableReference;
3635
use itertools::{Either, Itertools};
3736
use std::{collections::HashSet, sync::Arc};
@@ -111,14 +110,14 @@ impl TableFunctionImpl for FileDependenciesUdtf {
111110
"mv_dependencies: table '{table_name} is not a materialized view. (Materialized TableProviders must be registered using register_materialized"),
112111
))?;
113112

114-
Ok(Arc::new(ViewTable::try_new(
113+
Ok(Arc::new(ViewTable::new(
115114
mv_dependencies_plan(
116115
mv,
117116
self.row_metadata_registry.as_ref(),
118117
&self.config_options,
119118
)?,
120119
None,
121-
)?))
120+
)))
122121
}
123122
}
124123

@@ -216,7 +215,7 @@ impl TableFunctionImpl for StaleFilesUdtf {
216215
])?
217216
.build()?;
218217

219-
Ok(Arc::new(ViewTable::try_new(logical_plan, None)?))
218+
Ok(Arc::new(ViewTable::new(logical_plan, None)))
220219
}
221220
}
222221

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

253-
// First expand all wildcards
254-
let plan = ExpandWildcardRule {}.analyze(plan, config_options)?;
255-
256252
let pruned_plan_with_source_files = if partition_cols.is_empty() {
257253
get_source_files_all_partitions(
258254
materialized_view,

src/materialized/file_metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ impl FileMetadataBuilder {
668668
.append_value(format!("{store_url}{}", meta.location));
669669
self.last_modified
670670
.append_option(meta.last_modified.timestamp_nanos_opt());
671-
self.size.append_value(meta.size as u64); // this is not lossy assuming we're on a 64-bit platform
671+
self.size.append_value(meta.size); // this is not lossy assuming we're on a 64-bit platform
672672
}
673673

674674
fn finish(mut self) -> Result<RecordBatch> {

src/materialized/hive_partition.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ use arrow_schema::DataType;
2222

2323
use datafusion_common::{DataFusionError, Result, ScalarValue};
2424
use datafusion_expr::{
25-
expr::ScalarFunction, ColumnarValue, Expr, ScalarUDF, ScalarUDFImpl, Signature, TypeSignature,
26-
Volatility,
25+
expr::ScalarFunction, ColumnarValue, Expr, ScalarFunctionArgs, ScalarUDF, ScalarUDFImpl,
26+
Signature, TypeSignature, Volatility,
2727
};
2828

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

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

116-
let arrays = ColumnarValue::values_to_arrays(values)?;
117+
let arrays = ColumnarValue::values_to_arrays(&values)?;
117118

118119
let [file_paths, table_partition_columns]: [Option<&StringArray>; 2] =
119120
[&arrays[0], &arrays[1]].map(|arg| arg.as_any().downcast_ref());

src/rewrite/exploitation.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,6 @@ impl UserDefinedLogicalNodeCore for OneOf {
296296
write!(f, "OneOf")
297297
}
298298

299-
fn from_template(&self, _exprs: &[datafusion::prelude::Expr], inputs: &[LogicalPlan]) -> Self {
300-
Self {
301-
branches: inputs.to_vec(),
302-
}
303-
}
304-
305299
fn with_exprs_and_inputs(
306300
&self,
307301
_exprs: Vec<datafusion::prelude::Expr>,
@@ -459,6 +453,7 @@ impl DisplayAs for OneOfExec {
459453
)
460454
)
461455
}
456+
DisplayFormatType::TreeRender => Ok(()),
462457
}
463458
}
464459
}

0 commit comments

Comments
 (0)