Skip to content

Commit c99e986

Browse files
committed
comment
1 parent bad7348 commit c99e986

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

datafusion/expr-common/src/signature.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,10 @@ impl TypeSignatureClass {
247247
TypeSignatureClass::Timestamp if logical_type.is_timestamp() => {
248248
Ok(origin_type.to_owned())
249249
}
250-
TypeSignatureClass::Timestamp => {
251-
// TODO: Consider allowing the user to specify the default timestamp type instead of having it predefined in DataFusion when we have such use case
252-
// Use default timestamp type with nanosecond precision and no timezone
250+
// This is an existing use case for casting string to timestamp, since we don't have specific unit and timezone from string,
251+
// so we use the default timestamp type with nanosecond precision and no timezone
252+
// TODO: Consider allowing the user to specify the default timestamp type instead of having it predefined in DataFusion when we have more use cases
253+
TypeSignatureClass::Timestamp if logical_type == &NativeType::String => {
253254
logical_timestamp().default_cast_for(origin_type)
254255
}
255256
TypeSignatureClass::Date if logical_type.is_date() => {

0 commit comments

Comments
 (0)