liyubin117 commented on a change in pull request #18361:
URL: https://github.com/apache/flink/pull/18361#discussion_r811923573
##########
File path:
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
##########
@@ -410,15 +410,54 @@ SqlShowViews SqlShowViews() :
}
/**
-* Parse a "Show Tables" metadata query command.
+* SHOW TABLES FROM [catalog.] database sql call.
*/
SqlShowTables SqlShowTables() :
{
+ SqlIdentifier databaseName;
+ SqlCharStringLiteral likeLiteral = null;
+ String prep = "FROM";
+ boolean notLike = false;
+ SqlParserPos pos;
}
{
<SHOW> <TABLES>
+ [
+ [( <FROM> | <IN> { prep = "IN"; } )]
+ { pos = getPos(); }
+ databaseName = CompoundIdentifier()
+ [
+ [
+ <NOT>
+ {
+ notLike = true;
+ }
+ ]
+ <LIKE> <QUOTED_STRING>
+ {
+ String likeCondition = SqlParserUtil.parseString(token.image);
+ likeLiteral = SqlLiteral.createCharString(likeCondition,
getPos());
+ }
+ ]
+ {
+ return new SqlShowTables(pos, prep, databaseName, notLike,
likeLiteral);
+ }
Review comment:
we could make it simpler, done :)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]