Zhen Chen created CALCITE-7157:
----------------------------------

             Summary: 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


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)

Reply via email to