Skip to content

Commit b0eb9ee

Browse files
committed
Workaround timestamp types (#1)
1 parent e443304 commit b0eb9ee

1 file changed

Lines changed: 2 additions & 21 deletions

File tree

datafusion/substrait/src/logical_plan/consumer.rs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,27 +2409,8 @@ fn from_substrait_type(
24092409
},
24102410
r#type::Kind::Fp32(_) => Ok(DataType::Float32),
24112411
r#type::Kind::Fp64(_) => Ok(DataType::Float64),
2412-
r#type::Kind::Timestamp(ts) => {
2413-
// Kept for backwards compatibility, new plans should use PrecisionTimestamp(Tz) instead
2414-
#[allow(deprecated)]
2415-
match ts.type_variation_reference {
2416-
TIMESTAMP_SECOND_TYPE_VARIATION_REF => {
2417-
Ok(DataType::Timestamp(TimeUnit::Second, None))
2418-
}
2419-
TIMESTAMP_MILLI_TYPE_VARIATION_REF => {
2420-
Ok(DataType::Timestamp(TimeUnit::Millisecond, None))
2421-
}
2422-
TIMESTAMP_MICRO_TYPE_VARIATION_REF => {
2423-
Ok(DataType::Timestamp(TimeUnit::Microsecond, None))
2424-
}
2425-
TIMESTAMP_NANO_TYPE_VARIATION_REF => {
2426-
Ok(DataType::Timestamp(TimeUnit::Nanosecond, None))
2427-
}
2428-
v => not_impl_err!(
2429-
"Unsupported Substrait type variation {v} of type {s_kind:?}"
2430-
),
2431-
}
2432-
}
2412+
// TODO: DataDog-specific workaround, don't commit upstream
2413+
r#type::Kind::Timestamp(_) => Ok(DataType::Timestamp(TimeUnit::Nanosecond, None)),
24332414
r#type::Kind::PrecisionTimestamp(pts) => {
24342415
let unit = match pts.precision {
24352416
0 => Ok(TimeUnit::Second),

0 commit comments

Comments
 (0)