[ https://issues.apache.org/jira/browse/CALCITE-5078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17515898#comment-17515898 ]
Ruben Q L commented on CALCITE-5078: ------------------------------------ [~mamo], as others have mentioned, this is the expected behavior (Calcite uses by default the lexicographical orders for strings, i.e. String#compareTo). If you wish to specify a certain collation, there are some mechanisms when defining your varchar type. You can take a look at CALCITE-3951 and see some examples in [EnumerableStringComparisonTest.java|https://github.com/apache/calcite/blob/master/core/src/test/java/org/apache/calcite/test/enumerable/EnumerableStringComparisonTest.java] > ORDER BY gets confused by upper/lower case > ------------------------------------------ > > Key: CALCITE-5078 > URL: https://issues.apache.org/jira/browse/CALCITE-5078 > Project: Calcite > Issue Type: Bug > Affects Versions: 1.30.0 > Reporter: Magnus Mogren > Priority: Major > > This SQL returnes the values in the wrong order: > {{SELECT * FROM (VALUES ('a'), ('B')) AS tbl(col1) order by col1 asc}} > "B" is returned before "a". > -- This message was sent by Atlassian Jira (v8.20.1#820001)