[
https://issues.apache.org/jira/browse/CALCITE-7157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18017786#comment-18017786
]
Zhen Chen commented on CALCITE-7157:
------------------------------------
Indeed, it is the same. Then I will use CoreRules.SORT_REMOVE_CONSTANT_KEYS
to implement this rewrite. I have a question: Why did CALCITE-4702 choose to
rewrite it that way? Could it not have been directly eliminated as well?
> PostgreSQL does not support string literal in ORDER BY clause
> -------------------------------------------------------------
>
> Key: CALCITE-7157
> URL: https://issues.apache.org/jira/browse/CALCITE-7157
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.40.0
> Reporter: Zhen Chen
> Priority: Major
> Labels: pull-request-available
>
> In RelToSqlConverterTest, the following test passes, but the expectedSql does
> not work in PostgreSQL. PostgreSQL does not support string literal in ORDER
> BY clause.
> {code:java}
> @Test void testOrderByConstants() {
> final String query = ""
> + "select \"employee_id\", 'abc' as c\n"
> + "from \"foodmart\".\"employee\"\n"
> + "order by c";
> final String expectedSql = ""
> + "SELECT \"employee_id\", 'abc' AS \"C\"\n"
> + "FROM \"foodmart\".\"employee\"\n"
> + "ORDER BY 'abc'";
> sql(query).withPostgresql().ok(expectedSql);
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)