martin-g commented on code in PR #21665:
URL: https://github.com/apache/datafusion/pull/21665#discussion_r3092050112
##########
datafusion/expr-common/src/casts.rs:
##########
Review Comment:
It is a different use case but similar to the current one: Is something
similar needed also for other temporal types missing here (like Duration and
Interval for example) ?
##########
datafusion/expr-common/src/casts.rs:
##########
@@ -107,6 +113,14 @@ fn try_cast_numeric_literal(
return None;
}
+ // Date↔Timestamp casts are lossy (drop time-of-day or add midnight),
+ // so unwrapping would change comparison semantics.
+ if (is_date_type(&lit_data_type) && target_type.is_temporal())
Review Comment:
The comment is about Data<->Timestamp casts but this includes other temporal
types like Duration and Interval. Maybe the comment should be extended.
But this also would prevent casting from Date32 to Date64. I think this
might be desirable by someone.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]