wuchong commented on code in PR #20361:
URL: https://github.com/apache/flink/pull/20361#discussion_r939529472


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/command/AddJarOperation.java:
##########
@@ -19,22 +19,23 @@
 package org.apache.flink.table.operations.command;
 
 import org.apache.flink.table.operations.Operation;
+import org.apache.flink.table.resource.ResourceUri;
 
 /** Operation to describe an ADD JAR statement. */
 public class AddJarOperation implements Operation {
 
-    private final String path;
+    private final ResourceUri resourceUri;

Review Comment:
   This change looks unnecessary to me. This is an AddJarOperation instead of 
AddResourceOperation.  The resource in ADD JAR must be a JAR resource type. 



##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/batch/sql/FunctionITCase.java:
##########
@@ -142,6 +146,23 @@ public void 
testUserDefinedTemporaryCatalogFunctionByUsingJar() throws Exception
         testUserDefinedFunctionByUsingJar(functionDDL, dropFunctionDDL);
     }
 
+    @Test
+    public void testUsingAddJar() throws Exception {
+        tEnv().executeSql(String.format("ADD JAR '%s'", jarPath));
+
+        TableResult tableResult = tEnv().executeSql("SHOW JARS");
+        assertThat(
+                        CollectionUtil.iteratorToList(tableResult.collect())
+                                .equals(
+                                        Collections.singletonList(
+                                                Row.of(new 
Path(jarPath).getPath()))))
+                .isTrue();

Review Comment:
   Please use `assertThat(..).isEqualsTo(..)` for a better readable exception 
message when mismatch. 



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

Reply via email to