Skip to content

Commit 69f0291

Browse files
benbellickalamb
andauthored
chore: bump substrait version to 0.60.0 to use substrait spec v0.75.0 (#17866)
## Which issue does this PR close? - Closes #17865. ## What changes are included in this PR? Bump the `substrait` version to `v0.75.0` by bumping `substrait-rs` to `v0.60.0`. This PR was originally dependent on [this PR](#17888) to update the versions of some common dependencies, but that PR is now merged in. ## Are these changes tested? There are no tests here, but there is no change to any logic within datafusion. It is simply a bump in a dependency. Technically the public API does change, but as noted in the issue description, there is no change to internal logic because uri / urn from substrait plans are not used. ## Are there any user-facing changes? Yes. Previously substrait plans of spec version `v0.74.0` were accepted, and now `v0.75.0` is accepted. However, this is a backwards compatible change. The only difference is the inclusion of additional urn-based fields in substrait plans. In a later PR, the old uri-based fields will be dropped, which *will* be a breaking change. --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
1 parent 41566db commit 69f0291

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion/substrait/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ itertools = { workspace = true }
4040
object_store = { workspace = true }
4141
pbjson-types = { workspace = true }
4242
prost = { workspace = true }
43-
substrait = { version = "0.59", features = ["serde"] }
43+
substrait = { version = "0.62", features = ["serde"] }
4444
url = { workspace = true }
4545
tokio = { workspace = true, features = ["fs"] }
4646
uuid = { version = "1.17.0", features = ["v4"] }

datafusion/substrait/src/extensions.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,15 @@ impl TryFrom<&Vec<SimpleExtensionDeclaration>> for Extensions {
113113
}
114114

115115
impl From<Extensions> for Vec<SimpleExtensionDeclaration> {
116+
// Silence deprecation warnings for `extension_uri_reference` during the uri -> urn migration
117+
// See: https://github.com/substrait-io/substrait/issues/856
118+
#[allow(deprecated)]
116119
fn from(val: Extensions) -> Vec<SimpleExtensionDeclaration> {
117120
let mut extensions = vec![];
118121
for (f_anchor, f_name) in val.functions {
119122
let function_extension = ExtensionFunction {
120123
extension_uri_reference: u32::MAX,
124+
extension_urn_reference: u32::MAX,
121125
function_anchor: f_anchor,
122126
name: f_name,
123127
};
@@ -130,6 +134,7 @@ impl From<Extensions> for Vec<SimpleExtensionDeclaration> {
130134
for (t_anchor, t_name) in val.types {
131135
let type_extension = ExtensionType {
132136
extension_uri_reference: u32::MAX, // https://github.com/apache/datafusion/issues/11545
137+
extension_urn_reference: u32::MAX, // https://github.com/apache/datafusion/issues/11545
133138
type_anchor: t_anchor,
134139
name: t_name,
135140
};
@@ -142,6 +147,7 @@ impl From<Extensions> for Vec<SimpleExtensionDeclaration> {
142147
for (tv_anchor, tv_name) in val.type_variations {
143148
let type_variation_extension = ExtensionTypeVariation {
144149
extension_uri_reference: u32::MAX, // We don't register proper extension URIs yet
150+
extension_urn_reference: u32::MAX, // We don't register proper extension URIs yet
145151
type_variation_anchor: tv_anchor,
146152
name: tv_name,
147153
};

datafusion/substrait/src/logical_plan/producer/expr/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ use substrait::version;
6060
///
6161
/// Substrait also requires the input schema of the expressions to be included in the
6262
/// message. The field names of the input schema will be serialized.
63+
// Silence deprecation warnings for `extension_uris` during the uri -> urn migration
64+
// See: https://github.com/substrait-io/substrait/issues/856
65+
#[allow(deprecated)]
6366
pub fn to_substrait_extended_expr(
6467
exprs: &[(&Expr, &Field)],
6568
schema: &DFSchemaRef,
@@ -85,6 +88,7 @@ pub fn to_substrait_extended_expr(
8588
advanced_extensions: None,
8689
expected_type_urls: vec![],
8790
extension_uris: vec![],
91+
extension_urns: vec![],
8892
extensions: extensions.into(),
8993
version: Some(version::version_with_producer("datafusion")),
9094
referred_expr: substrait_exprs,

datafusion/substrait/src/logical_plan/producer/plan.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ use substrait::proto::{plan_rel, Plan, PlanRel, Rel, RelRoot};
2424
use substrait::version;
2525

2626
/// Convert DataFusion LogicalPlan to Substrait Plan
27+
// Silence deprecation warnings for `extension_uris` during the uri -> urn migration
28+
// See: https://github.com/substrait-io/substrait/issues/856
29+
#[allow(deprecated)]
2730
pub fn to_substrait_plan(
2831
plan: &LogicalPlan,
2932
state: &SessionState,
@@ -45,11 +48,13 @@ pub fn to_substrait_plan(
4548
Ok(Box::new(Plan {
4649
version: Some(version::version_with_producer("datafusion")),
4750
extension_uris: vec![],
51+
extension_urns: vec![],
4852
extensions: extensions.into(),
4953
relations: plan_rels,
5054
advanced_extensions: None,
5155
expected_type_urls: vec![],
5256
parameter_bindings: vec![],
57+
type_aliases: vec![],
5358
}))
5459
}
5560

0 commit comments

Comments
 (0)