Skip to content

Commit

Permalink
Fix CI to_timestamp() failed
Browse files Browse the repository at this point in the history
  • Loading branch information
comphead committed Oct 26, 2023
1 parent 871fd11 commit d3b1139
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion datafusion/expr/src/built_in_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,10 @@ impl BuiltinScalarFunction {
return plan_err!("The to_hex function can only accept integers.");
}
}),
BuiltinScalarFunction::ToTimestamp => Ok(Timestamp(Nanosecond, None)),
BuiltinScalarFunction::ToTimestamp => Ok(match &input_expr_types[0] {
dt if dt.is_integer() => Timestamp(Second, None),
_ => Timestamp(Nanosecond, None),
}),
BuiltinScalarFunction::ToTimestampMillis => Ok(Timestamp(Millisecond, None)),
BuiltinScalarFunction::ToTimestampMicros => Ok(Timestamp(Microsecond, None)),
BuiltinScalarFunction::ToTimestampNanos => Ok(Timestamp(Nanosecond, None)),
Expand Down

0 comments on commit d3b1139

Please sign in to comment.