jnh5y commented on code in PR #23612:
URL: https://github.com/apache/flink/pull/23612#discussion_r1406632513


##########
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/dql/SqlShowDatabases.java:
##########
@@ -29,14 +31,55 @@
 import java.util.Collections;
 import java.util.List;
 
-/** SHOW Databases sql call. */
+import static java.util.Objects.requireNonNull;
+
+/**
+ * SHOW Databases sql call. The full syntax for show databases is as 
followings:
+ *
+ * <pre>{@code
+ * SHOW DATABASES [ ( FROM | IN ) catalog_name] [ [NOT] (LIKE | ILIKE)
+ * <sql_like_pattern> ] statement
+ * }</pre>
+ */
 public class SqlShowDatabases extends SqlCall {
 
     public static final SqlSpecialOperator OPERATOR =
             new SqlSpecialOperator("SHOW DATABASES", SqlKind.OTHER);
 
-    public SqlShowDatabases(SqlParserPos pos) {
+    private final String preposition;
+    private final SqlIdentifier catalogName;
+    private final String likeType;
+    private final SqlCharStringLiteral likeLiteral;
+    private final boolean notLike;
+
+    public String[] getCatalog() {
+        return catalogName == null || catalogName.names.isEmpty()
+                ? new String[] {}
+                : catalogName.names.toArray(new String[0]);
+    }
+
+    public SqlShowDatabases(
+            SqlParserPos pos,
+            String preposition,
+            SqlIdentifier catalogName,
+            String likeType,
+            SqlCharStringLiteral likeLiteral,
+            boolean notLike) {
         super(pos);
+        this.preposition = preposition;
+        this.catalogName =

Review Comment:
   For example, I think it may make sense to check the `SqlIdentifier`  
`catalogName` here to see if it is has more than one part.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to