twalthr commented on a change in pull request #16781:
URL: https://github.com/apache/flink/pull/16781#discussion_r688584370



##########
File path: 
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/TableEnvironmentTest.scala
##########
@@ -666,12 +666,12 @@ class TableEnvironmentTest {
     val statement2 =
       """
         |LOAD MODULE dummy WITH (
-        |'dummy-version' = '2'
+        |  'dummy-version' = '2'
         |)
       """.stripMargin
     expectedException.expect(classOf[ValidationException])
     expectedException.expectMessage(
-      "Could not execute LOAD MODULE: (moduleName: [dummy], properties: 
[{dummy-version=2}])." +
+      "Could not execute LOAD MODULE: (moduleName: [dummy], options: 
[{dummy-version=2}])." +

Review comment:
       can we make the summary more like the SQL string?

##########
File path: 
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
##########
@@ -1330,21 +1328,23 @@ private TableResult 
createCatalog(CreateCatalogOperation operation) {
     }
 
     private TableResult loadModule(LoadModuleOperation operation) {
-        String exMsg = getDDLOpExecuteErrorMsg(operation.asSummaryString());
+        final String exMsg = 
getDDLOpExecuteErrorMsg(operation.asSummaryString());
         try {
-            // find module by name
-            Map<String, String> properties = new 
HashMap<>(operation.getProperties());
-            if (properties.containsKey(MODULE_TYPE)) {
+            final Map<String, String> options = new 
HashMap<>(operation.getOptions());

Review comment:
       we should move this check to `FactoryUtil.createModule` when we drop 
legacy

##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/module/CommonModuleOptions.java
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.module;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.configuration.ConfigOption;
+import org.apache.flink.configuration.ConfigOptions;
+import org.apache.flink.table.factories.Factory;
+
+/** A collection of {@link ConfigOption} which are consistently used in 
multiple modules. */
+@Internal
+public class CommonModuleOptions {
+
+    /**
+     * {@link ConfigOption} which is used during module discovery to match it 
against {@link
+     * Factory#factoryIdentifier()}.
+     */
+    public static final ConfigOption<String> MODULE_TYPE =

Review comment:
       isn't this already deprecated?

##########
File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/module/hive/HiveModuleOptions.java
##########
@@ -18,18 +18,14 @@
 
 package org.apache.flink.table.module.hive;
 
-import org.apache.flink.table.descriptors.DescriptorProperties;
-import org.apache.flink.table.descriptors.ModuleDescriptorValidator;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.configuration.ConfigOption;
+import org.apache.flink.configuration.ConfigOptions;
 
-/** Validator for {@link HiveModuleDescriptor}. */
-public class HiveModuleDescriptorValidator extends ModuleDescriptorValidator {
-    public static final String MODULE_TYPE_HIVE = "hive";
-    public static final String MODULE_HIVE_VERSION = "hive-version";
+/** Configuration options for the Hive module. */
+@PublicEvolving
+public class HiveModuleOptions {

Review comment:
       add private constructor




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