Skip to content

Commit e9284cf

Browse files
authored
Workaround timestamp types (#1)
1 parent 26058ac commit e9284cf

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

datafusion/substrait/src/logical_plan/consumer.rs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,27 +2356,8 @@ fn from_substrait_type(
23562356
},
23572357
r#type::Kind::Fp32(_) => Ok(DataType::Float32),
23582358
r#type::Kind::Fp64(_) => Ok(DataType::Float64),
2359-
r#type::Kind::Timestamp(ts) => {
2360-
// Kept for backwards compatibility, new plans should use PrecisionTimestamp(Tz) instead
2361-
#[allow(deprecated)]
2362-
match ts.type_variation_reference {
2363-
TIMESTAMP_SECOND_TYPE_VARIATION_REF => {
2364-
Ok(DataType::Timestamp(TimeUnit::Second, None))
2365-
}
2366-
TIMESTAMP_MILLI_TYPE_VARIATION_REF => {
2367-
Ok(DataType::Timestamp(TimeUnit::Millisecond, None))
2368-
}
2369-
TIMESTAMP_MICRO_TYPE_VARIATION_REF => {
2370-
Ok(DataType::Timestamp(TimeUnit::Microsecond, None))
2371-
}
2372-
TIMESTAMP_NANO_TYPE_VARIATION_REF => {
2373-
Ok(DataType::Timestamp(TimeUnit::Nanosecond, None))
2374-
}
2375-
v => not_impl_err!(
2376-
"Unsupported Substrait type variation {v} of type {s_kind:?}"
2377-
),
2378-
}
2379-
}
2359+
// TODO: DataDog-specific workaround, don't commit upstream
2360+
r#type::Kind::Timestamp(_) => Ok(DataType::Timestamp(TimeUnit::Nanosecond, None)),
23802361
r#type::Kind::PrecisionTimestamp(pts) => {
23812362
let unit = match pts.precision {
23822363
0 => Ok(TimeUnit::Second),

0 commit comments

Comments
 (0)