[ https://issues.apache.org/jira/browse/CALCITE-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrei Sereda closed CALCITE-4080. ---------------------------------- Released as part of 1.25 ([68b02dfd4af15bc|https://github.com/apache/calcite/commit/68b02dfd4af15bc94a91a0cd2a30655d04439555]) > Allow character literals as column aliases, if > SqlConformance.allowCharLiteralAlias() > ------------------------------------------------------------------------------------- > > Key: CALCITE-4080 > URL: https://issues.apache.org/jira/browse/CALCITE-4080 > Project: Calcite > Issue Type: Bug > Components: core > Affects Versions: 1.23.0 > Reporter: Dan Cojocaru > Assignee: Julian Hyde > Priority: Major > Labels: pull-request-available > Fix For: 1.25.0 > > Time Spent: 10m > Remaining Estimate: 0h > > Exception occurs while parsing query with quoted alias for select columns. > {code:java} > final FrameworkConfig config = Frameworks.newConfigBuilder() > .parserConfig(SqlParser.configBuilder().setLex(Lex.MYSQL) > .setConformance(SqlConformanceEnum.MYSQL_5).build()) > .programs(Programs.ofRules(Programs.RULE_SET)) > .build(); > Planner p = Frameworks.getPlanner(config); > SqlNode n = p.parse("SELECT 1 AS 'some alias' from dual"); > {code} > The following exception is thrown: > {code:java} > org.apache.calcite.sql.parser.SqlParseException: Encountered "\'some alias\'" > at line 1, column 13. > Was expecting one of: > <BRACKET_QUOTED_IDENTIFIER> ... > <QUOTED_IDENTIFIER> ... > <BACK_QUOTED_IDENTIFIER> ... > <IDENTIFIER> ... > <UNICODE_QUOTED_IDENTIFIER> ...{code} > If query is changed into : > {code:java} > "SELECT 1 AS some_alias from dual" > {code} > the query is parsed correctly. > > Quoted aliases ( e.g: 'some alias' ) {color:#172b4d}should be valid as > well.{color} -- This message was sent by Atlassian Jira (v8.3.4#803005)