You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Gustavo de Morais (Jira)" <ji...@apache.org> on 2026/07/28 11:15:00 UTC
[jira] [Created] (FLINK-40250) Non-comparable types in ORDER BY / GROUP BY throw UnsupportedOperationException instead of a clean ValidationException
Gustavo de Morais created FLINK-40250:
-----------------------------------------
Summary: Non-comparable types in ORDER BY / GROUP BY throw UnsupportedOperationException instead of a clean ValidationException
Key: FLINK-40250
URL: https://issues.apache.org/jira/browse/FLINK-40250
Project: Flink
Issue Type: Improvement
Components: Table SQL / API
Affects Versions: 2.3.0
Reporter: Gustavo de Morais
Assignee: Gustavo de Morais
Using a non-comparable type (MAP, MULTISET, VARIANT, TIMESTAMP_WITH_TIME_ZONE) as an ordering/grouping key throws a raw UnsupportedOperationException from comparator codegen instead of a user-facing clean and easy to digest ValidationException.
Reproduce:
SELECT COUNT(*) FROM t GROUP BY map_column;
Now: GenerateUtils.generateCompare throws
"UnsupportedOperationException: Type(MAP<...>) is not an orderable data type, ..."
Expected: a ValidationException, e.g.
"Type 'MAP<...>' cannot be used for comparisons, so it is not supported in
ORDER BY, GROUP BY, DISTINCT, or as a join or window ordering key."
--
This message was sent by Atlassian Jira
(v8.20.10#820010)