Skip to content

Commit

Permalink
allow type extensions, even if they get ignored, and use the type var…
Browse files Browse the repository at this point in the history
…iation for interval-month-day-nano that spark will produce
  • Loading branch information
Blizzara committed Jul 15, 2024
1 parent a9d4d1d commit 8a16f8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions datafusion/substrait/src/logical_plan/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ pub async fn from_substrait_plan(
let function_extension = plan
.extensions
.iter()
.map(|e| match &e.mapping_type {
.flat_map(|e| match &e.mapping_type {
Some(ext) => match ext {
MappingType::ExtensionFunction(ext_f) => {
Ok((ext_f.function_anchor, &ext_f.name))
Some(Ok((ext_f.function_anchor, &ext_f.name)))
}
_ => not_impl_err!("Extension type not supported: {ext:?}"),
_ => None,
},
None => not_impl_err!("Cannot parse empty extension"),
None => Some(not_impl_err!("Cannot parse empty extension")),
})
.collect::<Result<HashMap<_, _>>>()?;

Expand Down
2 changes: 1 addition & 1 deletion datafusion/substrait/src/variation_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub const INTERVAL_DAY_TIME_TYPE_REF: u32 = 2;
/// [`DataType::Interval`]: datafusion::arrow::datatypes::DataType::Interval
/// [`IntervalUnit::MonthDayNano`]: datafusion::arrow::datatypes::IntervalUnit::MonthDayNano
/// [`ScalarValue::IntervalMonthDayNano`]: datafusion::common::ScalarValue::IntervalMonthDayNano
pub const INTERVAL_MONTH_DAY_NANO_TYPE_REF: u32 = 3;
pub const INTERVAL_MONTH_DAY_NANO_TYPE_REF: u32 = 0;

// For User Defined URLs
/// For [`DataType::Interval`] with [`IntervalUnit::YearMonth`].
Expand Down

0 comments on commit 8a16f8e

Please sign in to comment.