LantaoJin commented on PR #5330: URL: https://github.com/apache/calcite/pull/5330#issuecomment-6186576409
> I made a comment in Jira. In our implementation, and in the Calcite runtime, all types implement Comparable. This would be a breaking change for us. Thanks for looking at this so quick. As far as I can tell, the change only affects types that explicitly declare comparability `NONE`, and Calcite's built-in types never do. `RelDataTypeImpl.getComparability()` returns `ALL`, and the only override in core is `ObjectSqlType`, which returns the comparability it was constructed with (`SingleColumnAliasRelDataType` just delegates). So `ARRAY`, `MAP`, `MULTISET`, `ROW` and the types created by `CREATE TYPE` all report `ALL`, and `ARG_MIN` / `ARG_MAX` / `MIN_BY` / `MAX_BY` on them validate exactly as before. In this repository the only type constructed with `NONE` is the testkit's `ADDRESS` fixture, which is what the new test uses. For a type that does declare `NONE`, `MIN` and `MAX` already reject it at validation, through `ComparableOperandTypeChecker`. This PR only makes the four `ARG_*` / `*_BY` functions consistent with them, and makes `ANY_COMPARABLE` honour `throwOnFailure` like the other checkers. Which of your types would be affected? If one of them reports `NONE` but is comparable at run time, I would expect `MIN` on it to fail today as well. If you would rather keep `ARG_MIN` permissive for such types, I am happy to close this. -- 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]
