[
https://issues.apache.org/jira/browse/CALCITE-7157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18017781#comment-18017781
]
Zhen Chen commented on CALCITE-7157:
------------------------------------
Yes, I initially intended to handle it this way, but after seeing CALCITE-4702,
I changed my mind. If you believe using CoreRules.SORT_REMOVE_CONSTANT_KEYS
is a better approach for dialect conversion, I will adopt this rule instead.
> 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)