Skip to content

Commit 600a4d8

Browse files
authored
upgrade to datafusion 45 (#38)
* upgrade to datafusion 45 * fix test
1 parent 7616021 commit 600a4d8

File tree

3 files changed

+33
-29
lines changed

3 files changed

+33
-29
lines changed

Cargo.toml

+11-11
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ keywords = ["arrow", "arrow-rs", "datafusion"]
2828
rust-version = "1.80"
2929

3030
[dependencies]
31-
arrow = "53"
32-
arrow-schema = "53"
31+
arrow = "54"
32+
arrow-schema = "54"
3333
async-trait = "0.1"
3434
dashmap = "6"
35-
datafusion = "43"
36-
datafusion-common = "43"
37-
datafusion-expr = "43"
38-
datafusion-functions = "43"
39-
datafusion-functions-aggregate = "43"
40-
datafusion-optimizer = "43"
41-
datafusion-physical-expr = "43"
42-
datafusion-physical-plan = "43"
43-
datafusion-sql = "43"
35+
datafusion = "45"
36+
datafusion-common = "45"
37+
datafusion-expr = "45"
38+
datafusion-functions = "45"
39+
datafusion-functions-aggregate = "45"
40+
datafusion-optimizer = "45"
41+
datafusion-physical-expr = "45"
42+
datafusion-physical-plan = "45"
43+
datafusion-sql = "45"
4444
futures = "0.3"
4545
itertools = "0.13"
4646
log = "0.4"

src/materialized/dependencies.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
// under the License.
1717

1818
use datafusion::{
19-
catalog::CatalogProviderList,
19+
catalog::{CatalogProviderList, TableFunctionImpl},
2020
config::{CatalogOptions, ConfigOptions},
21-
datasource::{function::TableFunctionImpl, provider_as_source, TableProvider, ViewTable},
21+
datasource::{provider_as_source, TableProvider, ViewTable},
2222
prelude::{flatten, get_field, make_array},
2323
};
2424
use datafusion_common::{
@@ -1549,9 +1549,9 @@ mod test {
15491549
name: "window & unnest",
15501550
query_to_analyze: "
15511551
SELECT
1552-
\"unnest_placeholder(date).year\" AS year,
1553-
\"unnest_placeholder(date).month\" AS month,
1554-
\"unnest_placeholder(date).day\" AS day,
1552+
\"__unnest_placeholder(date).year\" AS year,
1553+
\"__unnest_placeholder(date).month\" AS month,
1554+
\"__unnest_placeholder(date).day\" AS day,
15551555
arr
15561556
FROM (
15571557
SELECT
@@ -1568,14 +1568,14 @@ mod test {
15681568
)",
15691569
projection: &["year", "month", "day"],
15701570
expected_plan: vec![
1571-
"+--------------+---------------------------------------------------------------------------------------------------------------------------------+",
1572-
"| plan_type | plan |",
1573-
"+--------------+---------------------------------------------------------------------------------------------------------------------------------+",
1574-
"| logical_plan | Projection: unnest_placeholder(date).year AS year, unnest_placeholder(date).month AS month, unnest_placeholder(date).day AS day |",
1575-
"| | Unnest: lists[] structs[unnest_placeholder(date)] |",
1576-
"| | Projection: named_struct(Utf8(\"year\"), t2.year, Utf8(\"month\"), t2.month, Utf8(\"day\"), t2.day) AS unnest_placeholder(date) |",
1577-
"| | TableScan: t2 projection=[year, month, day] |",
1578-
"+--------------+---------------------------------------------------------------------------------------------------------------------------------+",
1571+
"+--------------+---------------------------------------------------------------------------------------------------------------------------------------+",
1572+
"| plan_type | plan |",
1573+
"+--------------+---------------------------------------------------------------------------------------------------------------------------------------+",
1574+
"| logical_plan | Projection: __unnest_placeholder(date).year AS year, __unnest_placeholder(date).month AS month, __unnest_placeholder(date).day AS day |",
1575+
"| | Unnest: lists[] structs[__unnest_placeholder(date)] |",
1576+
"| | Projection: named_struct(Utf8(\"year\"), t2.year, Utf8(\"month\"), t2.month, Utf8(\"day\"), t2.day) AS __unnest_placeholder(date) |",
1577+
"| | TableScan: t2 projection=[year, month, day] |",
1578+
"+--------------+---------------------------------------------------------------------------------------------------------------------------------------+",
15791579
],
15801580
expected_output: vec![
15811581
"+------+-------+-----+",

src/materialized/file_metadata.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ use datafusion::physical_plan::limit::LimitStream;
3030
use datafusion::physical_plan::metrics::{BaselineMetrics, ExecutionPlanMetricsSet, MetricsSet};
3131
use datafusion::physical_plan::stream::RecordBatchStreamAdapter;
3232
use datafusion::physical_plan::{
33-
DisplayAs, DisplayFormatType, ExecutionMode, ExecutionPlan, Partitioning, PhysicalExpr,
34-
PlanProperties,
33+
DisplayAs, DisplayFormatType, ExecutionPlan, Partitioning, PhysicalExpr, PlanProperties,
3534
};
3635
use datafusion::{
3736
catalog::CatalogProviderList, execution::TaskContext, physical_plan::SendableRecordBatchStream,
3837
};
3938
use datafusion_common::{DataFusionError, Result, ScalarValue, ToDFSchema};
4039
use datafusion_expr::{Expr, Operator, TableProviderFilterPushDown, TableType};
40+
use datafusion_physical_plan::execution_plan::{Boundedness, EmissionType};
4141
use futures::stream::{self, BoxStream};
4242
use futures::{future, Future, FutureExt, StreamExt, TryStreamExt};
4343
use itertools::Itertools;
@@ -152,8 +152,12 @@ impl FileMetadataExec {
152152
};
153153
let eq_properties = EquivalenceProperties::new(projected_schema);
154154
let partitioning = Partitioning::UnknownPartitioning(1);
155-
let execution_mode = ExecutionMode::Bounded;
156-
let plan_properties = PlanProperties::new(eq_properties, partitioning, execution_mode);
155+
let plan_properties = PlanProperties::new(
156+
eq_properties,
157+
partitioning,
158+
EmissionType::Final,
159+
Boundedness::Bounded,
160+
);
157161

158162
let exec = Self {
159163
table_schema,
@@ -724,7 +728,7 @@ mod test {
724728
use anyhow::{Context, Result};
725729
use datafusion::{
726730
assert_batches_sorted_eq,
727-
catalog_common::{MemoryCatalogProvider, MemorySchemaProvider},
731+
catalog::{MemoryCatalogProvider, MemorySchemaProvider},
728732
execution::{
729733
object_store::{DefaultObjectStoreRegistry, ObjectStoreRegistry},
730734
runtime_env::RuntimeEnvBuilder,

0 commit comments

Comments
 (0)