Copilot commented on code in PR #63234:
URL: https://github.com/apache/doris/pull/63234#discussion_r3238749284


##########
fe/fe-core/src/test/java/org/apache/doris/datasource/ExternalCatalogTest.java:
##########
@@ -144,6 +145,33 @@ public void testExternalCatalogAutoAnalyze() throws 
Exception {
         Assertions.assertTrue(catalog.enableAutoAnalyze());
     }
 
+    @Test
+    public void testShowCreateCatalogMasksSensitiveProperties() throws 
Exception {
+        String createStmt = "create catalog mask_iceberg_rest properties(\n"
+                + "    \"type\" = \"iceberg\",\n"
+                + "    \"iceberg.catalog.type\" = \"rest\",\n"
+                + "    \"iceberg.rest.uri\" = \"http://localhost:8181\",\n";
+                + "    \"warehouse\" = \"test_db\",\n"
+                + "    \"iceberg.rest.security.type\" = \"oauth2\",\n"
+                + "    \"iceberg.rest.oauth2.credential\" = 
\"super-secret-pat\",\n"
+                + "    \"iceberg.rest.oauth2.server-uri\" = 
\"http://localhost:8181/v1/oauth/tokens\",\n";
+                + "    \"iceberg.rest.oauth2.scope\" = 
\"session:role:TEST_ROLE\"\n"
+                + ");";
+
+        NereidsParser nereidsParser = new NereidsParser();
+        LogicalPlan logicalPlan = nereidsParser.parseSingle(createStmt);
+        if (logicalPlan instanceof CreateCatalogCommand) {
+            ((CreateCatalogCommand) logicalPlan).run(rootCtx, null);
+        }

Review Comment:
   The catalog creation is wrapped in an `instanceof` check with no `else` 
branch. If parsing returns a different plan type (e.g., due to a future parser 
change), the test will silently skip the creation step and then fail on 
`showCreateCatalog` with a misleading error. Add an 
`Assertions.assertTrue(logicalPlan instanceof CreateCatalogCommand)` (or `fail` 
in the else branch) to make the failure mode explicit.
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to