twalthr commented on a change in pull request #11156: [FLINK-16183][table-api]
Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#discussion_r383133874
##########
File path:
flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/calcite/CalciteParser.java
##########
@@ -60,12 +62,33 @@ public SqlNode parse(String sql) {
*/
public SqlIdentifier parseIdentifier(String identifier) {
try {
- SqlParser parser = SqlParser.create(identifier, config);
- SqlNode sqlNode = parser.parseExpression();
- return (SqlIdentifier) sqlNode;
+ return
createFlinkParser(identifier).TableApiIdentifier();
} catch (Exception e) {
throw new SqlParserException(String.format(
- "Invalid SQL identifier %s. All SQL keywords
must be escaped.", identifier));
+ "Invalid SQL identifier %s.", identifier));
}
}
+
+ private FlinkSqlParserImpl createFlinkParser(String expr) {
+ SourceStringReader reader = new SourceStringReader(expr);
Review comment:
can you document the changes between this method and `SqlParser.create()`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services