alamb commented on code in PR #10646: URL: https://github.com/apache/datafusion/pull/10646#discussion_r1614534288
########## datafusion/substrait/src/variation_const.rs: ########## @@ -37,3 +38,58 @@ pub const DEFAULT_CONTAINER_TYPE_REF: u32 = 0; pub const LARGE_CONTAINER_TYPE_REF: u32 = 1; pub const DECIMAL_128_TYPE_REF: u32 = 0; pub const DECIMAL_256_TYPE_REF: u32 = 1; + +// For custom types +/// For [`DataType::Interval`] with [`IntervalUnit::YearMonth`]. +/// +/// An `i32` for elapsed whole months. See also [`ScalarValue::IntervalYearMonth`] +/// for the literal definition in DataFusion. +/// +/// [`DataType::Interval`]: datafusion::arrow::datatypes::DataType::Interval +/// [`IntervalUnit::YearMonth`]: datafusion::arrow::datatypes::IntervalUnit::YearMonth +/// [`ScalarValue::IntervalYearMonth`]: datafusion::common::ScalarValue::IntervalYearMonth +pub const INTERVAL_YEAR_MONTH_TYPE_REF: u32 = 1; + +/// For [`DataType::Interval`] with [`IntervalUnit::DayTime`]. +/// +/// An `i64` as: +/// - days: `i32` +/// - milliseconds: `i32` +/// +/// See also [`ScalarValue::IntervalDayTime`] for the literal definition in DataFusion. +/// +/// [`DataType::Interval`]: datafusion::arrow::datatypes::DataType::Interval +/// [`IntervalUnit::DayTime`]: datafusion::arrow::datatypes::IntervalUnit::DayTime +/// [`ScalarValue::IntervalDayTime`]: datafusion::common::ScalarValue::IntervalDayTime +pub const INTERVAL_DAY_TIME_TYPE_REF: u32 = 2; + +/// For [`DataType::Interval`] with [`IntervalUnit::MonthDayNano`]. +/// +/// An `i128` as: +/// - months: `i32` +/// - days: `i32` +/// - nanoseconds: `i64` +/// +/// See also [`ScalarValue::IntervalMonthDayNano`] for the literal definition in DataFusion. Review Comment: FYI the interval implementation is changing in the next arrow I think: https://github.com/apache/arrow-rs/pull/5769 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org