You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/08/06 14:02:51 UTC
[GitHub] [flink] wuchong commented on a diff in pull request #20361: [FLINK-27790][Table SQL / API] Port ADD JAR /SHOW JARS syntax implementation from SqlClient to TableEnvironment side
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org