Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.23.0
Description
Exception occurs while parsing query with quoted alias for select columns.
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");
The following exception is thrown:
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> ...
If query is changed into :
"SELECT 1 AS some_alias from dual"
the query is parsed correctly.
Quoted aliases ( e.g: 'some alias' ) should be valid as well.
Attachments
Issue Links
- links to