ZhangChaoming commented on a change in pull request #18386:
URL: https://github.com/apache/flink/pull/18386#discussion_r840207227



##########
File path: 
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/dql/SqlShowDatabases.java
##########
@@ -49,8 +70,44 @@ public SqlOperator getOperator() {
         return Collections.EMPTY_LIST;
     }
 
+    public String getCatalogName() {
+        return Objects.isNull(this.catalogName) ? null : 
catalogName.getSimple();
+    }
+
+    public boolean isNotLike() {
+        return notLike;
+    }
+
+    public String getPreposition() {
+        return preposition;
+    }
+
+    public String getLikeSqlPattern() {
+        return Objects.isNull(this.likeLiteral) ? null : 
likeLiteral.getValueAs(String.class);
+    }
+
+    public SqlCharStringLiteral getLikeLiteral() {
+        return likeLiteral;
+    }
+
+    public boolean isWithLike() {
+        return Objects.nonNull(likeLiteral);
+    }
+
     @Override
     public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
-        writer.keyword("SHOW DATABASES");
+        if (this.preposition == null) {
+            writer.keyword("SHOW DATABASES");
+        } else if (catalogName != null) {
+            writer.keyword("SHOW DATABASES " + this.preposition);
+            catalogName.unparse(writer, leftPrec, rightPrec);
+        }
+        if (likeLiteral != null) {
+            if (notLike) {
+                writer.keyword(String.format("NOT LIKE '%s'", 
getLikeSqlPattern()));

Review comment:
       @RocMarshal , I am looking forard for your response.




-- 
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