barrkel commented on code in PR #3336:
URL: https://github.com/apache/calcite/pull/3336#discussion_r1537378040
##########
core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java:
##########
@@ -896,6 +900,12 @@ public static boolean canCastFrom(
if (toType.equals(fromType)) {
return true;
}
+ // If fromType is a measure, you should compare the inner type otherwise
it will
+ // always return TRUE because the SqlTypeFamily of MEASURE is ANY
+ if (isMeasure(fromType)) {
Review Comment:
@tanclary If I understand this code correctly, this is testing for implicit
(I think) conversions presumably as part of type checking on behalf of the
caller. But it's not wholly clear to me that measures ought to be implicitly
convertible to anything without applying `AGGREGATE`. Is it meaningful to
compute anything with measures in themselves, outside an aggregation context?
At the very least, there's an assumption of naked measures and implicit
aggregation, right?
--
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]