twalthr commented on a change in pull request #18464:
URL: https://github.com/apache/flink/pull/18464#discussion_r791415561
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/module/Module.java
##########
@@ -36,17 +36,28 @@
public interface Module {
/**
- * List names of all functions in this module.
+ * List names of all functions in this module. It excludes internal
functions.
*
* @return a set of function names
*/
default Set<String> listFunctions() {
return Collections.emptySet();
}
+ /**
+ * List names of all functions in this module. It can include internal
functions.
+ *
+ * @return a set of function names
+ */
+ default Set<String> listFunctions(boolean includeInternal) {
Review comment:
The module system does not the concept of an internal function. Instead
it is only able to hide certain functions during listing. I rephrased this part
and split it into a separate commit.
##########
File path:
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/BuiltInSqlFunction.java
##########
@@ -0,0 +1,244 @@
+/*
+ * 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.planner.functions.sql;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.functions.BuiltInFunctionDefinition;
+import org.apache.flink.table.planner.functions.bridging.BridgingSqlFunction;
+
+import org.apache.calcite.sql.SqlFunction;
+import org.apache.calcite.sql.SqlFunctionCategory;
+import org.apache.calcite.sql.SqlKind;
+import org.apache.calcite.sql.SqlOperatorBinding;
+import org.apache.calcite.sql.type.SqlOperandTypeChecker;
+import org.apache.calcite.sql.type.SqlOperandTypeInference;
+import org.apache.calcite.sql.type.SqlReturnTypeInference;
+import org.apache.calcite.sql.validate.SqlMonotonicity;
+
+import javax.annotation.Nullable;
+
+import java.util.Optional;
+import java.util.function.Function;
+
+import static
org.apache.flink.table.functions.BuiltInFunctionDefinition.DEFAULT_VERSION;
+import static
org.apache.flink.table.functions.BuiltInFunctionDefinition.qualifyFunctionName;
+import static
org.apache.flink.table.functions.BuiltInFunctionDefinition.validateFunction;
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * SQL version of {@link BuiltInFunctionDefinition} in cases where {@link
BridgingSqlFunction} does
+ * not apply. This is the case when the operator has a special parsing syntax
or uses other
+ * Calcite-specific features that are not exposed via {@link
BuiltInFunctionDefinition} yet.
+ *
+ * <p>Note: Try to keep usages of this class to a minimum and use Flink's
{@link
+ * BuiltInFunctionDefinition} stack instead.
+ *
+ * <p>For simple functions, use the provided builder. Otherwise, this class
can also be extended.
+ */
+@Internal
+public class BuiltInSqlFunction extends SqlFunction implements
BuiltInSqlOperator {
Review comment:
This change is part of the internal/versioning story. However, I will
split the refactorings into a separate commit.
--
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]