HuangZhenQiu commented on a change in pull request #10294: [FLINK-14913][table]
refactor CatalogFunction to remove properties
URL: https://github.com/apache/flink/pull/10294#discussion_r349904552
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/CatalogFunctionImpl.java
##########
@@ -20,40 +20,36 @@
import org.apache.flink.util.StringUtils;
-import java.util.HashMap;
-import java.util.Map;
import java.util.Optional;
import static org.apache.flink.util.Preconditions.checkArgument;
-import static org.apache.flink.util.Preconditions.checkNotNull;
/**
* A catalog function implementation.
*/
public class CatalogFunctionImpl implements CatalogFunction {
private final String className; // Fully qualified class name of the
function
- private final Map<String, String> properties;
+ private final boolean isGeneric;
- public CatalogFunctionImpl(String className, Map<String, String>
properties) {
+ public CatalogFunctionImpl(String className) {
+ this(className, true);
+ }
+
+ public CatalogFunctionImpl(String className, boolean isGeneric) {
checkArgument(!StringUtils.isNullOrWhitespaceOnly(className),
"className cannot be null or empty");
this.className = className;
- this.properties = checkNotNull(properties, "properties cannot
be null");
+ this.isGeneric = isGeneric;
Review comment:
I find actually there several test cases, such as GenericInMemoryCatalogTest
use a raw class String without real class definition. Using the assignable
class check either in CatalogFunctionImpl or test case will cause an extra code
change. To limit the scope of this PR, How about we keep it as now for the
consistency with how we handle generic lable of table and view in hive
catalog?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services