jxeditor commented on a change in pull request #12431:
URL: https://github.com/apache/flink/pull/12431#discussion_r434289783



##########
File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/SqlCommandParser.java
##########
@@ -132,11 +132,10 @@ private SqlCommandParser() {
                        cmd = SqlCommand.DROP_CATALOG;
                } else if (operation instanceof UseCatalogOperation) {
                        cmd = SqlCommand.USE_CATALOG;
-                       operands = new String[] { String.format("`%s`", 
((UseCatalogOperation) operation).getCatalogName()) };
+                       operands = new String[] { ((UseCatalogOperation) 
operation).getCatalogName() };

Review comment:
       ```suggestion
                        operands = new 
String[]{StringUtils.strip(((UseCatalogOperation) operation).getCatalogName(), 
"`")};
   ```

##########
File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/SqlCommandParser.java
##########
@@ -132,11 +132,10 @@ private SqlCommandParser() {
                        cmd = SqlCommand.DROP_CATALOG;
                } else if (operation instanceof UseCatalogOperation) {
                        cmd = SqlCommand.USE_CATALOG;
-                       operands = new String[] { String.format("`%s`", 
((UseCatalogOperation) operation).getCatalogName()) };
+                       operands = new String[] { ((UseCatalogOperation) 
operation).getCatalogName() };
                } else if (operation instanceof UseDatabaseOperation) {
                        cmd = SqlCommand.USE;
-                       UseDatabaseOperation op = ((UseDatabaseOperation) 
operation);
-                       operands = new String[] { String.format("`%s`.`%s`", 
op.getCatalogName(), op.getDatabaseName()) };
+                       operands = new String[] { ((UseDatabaseOperation) 
operation).getDatabaseName() };

Review comment:
       ```suggestion
                        operands = new String[]{String.format("%s.%s", 
StringUtils.strip(op.getCatalogName(), "`"), 
StringUtils.strip(op.getDatabaseName(), "`"))};
   ```




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to