Skip to content

Commit

Permalink
chore: bump datafusion version to 37
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Apr 9, 2024
1 parent 8a9a40b commit 4985c90
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ zstd = "0.12"
arrow-json = "51.0.0"
async-trait = "0.1.77"
criterion = { version = "0.5", default-features = false, features = ["async_tokio"] }
datafusion = "36.0.0"
datafusion-expr = "36.0.0"
datafusion-physical-expr = "36.0.0"
datafusion = "37.0.0"
datafusion-expr = "37.0.0"
datafusion-physical-expr = "37.0.0"
object_store = "0.9.0"
pretty_assertions = "1.3.0"
serde_json = { version = "1.0", default-features = false, features = ["std"] }
Expand Down
24 changes: 15 additions & 9 deletions examples/datafusion_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ use datafusion::error::Result;
use datafusion::execution::context::{SessionState, TaskContext};
use datafusion::execution::object_store::ObjectStoreUrl;
use datafusion::physical_plan::{
DisplayAs, DisplayFormatType, ExecutionPlan, Partitioning, SendableRecordBatchStream,
DisplayAs, DisplayFormatType, ExecutionMode, ExecutionPlan, Partitioning, PlanProperties,
SendableRecordBatchStream,
};
use datafusion::prelude::*;
use datafusion_expr::{Expr, LogicalPlanBuilder};
use datafusion_physical_expr::PhysicalSortExpr;
use datafusion_physical_expr::EquivalenceProperties;
use orc_rust::ArrowReaderBuilder;

use async_trait::async_trait;
Expand Down Expand Up @@ -101,11 +102,20 @@ impl TableProvider for OrcDataSource {
struct OrcExec {
orc: OrcDataSource,
schema: SchemaRef,
properties: PlanProperties,
}

impl OrcExec {
fn new(orc: OrcDataSource, schema: SchemaRef) -> Result<Self> {
Ok(Self { orc, schema })
Ok(Self {
orc,
schema: schema.clone(),
properties: PlanProperties::new(
EquivalenceProperties::new(schema),
Partitioning::UnknownPartitioning(1),
ExecutionMode::Bounded,
),
})
}
}

Expand Down Expand Up @@ -135,12 +145,8 @@ impl ExecutionPlan for OrcExec {
self.schema.clone()
}

fn output_partitioning(&self) -> Partitioning {
Partitioning::UnknownPartitioning(1)
}

fn output_ordering(&self) -> Option<&[PhysicalSortExpr]> {
None
fn properties(&self) -> &PlanProperties {
&self.properties
}

fn execute(
Expand Down

0 comments on commit 4985c90

Please sign in to comment.