Cpaulyz commented on code in PR #14223:
URL: https://github.com/apache/iotdb/pull/14223#discussion_r1868795946
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ShowFunctionsTask.java:
##########
@@ -175,6 +260,15 @@ private static Binary getFunctionType(UDFInformation
udfInformation) {
} else if (TreeUDFUtils.isUDAF(udfInformation.getFunctionName())) {
return BINARY_MAP.get(FUNCTION_TYPE_EXTERNAL_UDAF);
}
+ } else {
+ if
(TableUDFUtils.tryGetScalarFunction(udfInformation.getFunctionName()) != null) {
+ return BINARY_MAP.get(FUNCTION_TYPE_USER_DEFINED_SCALAR_FUNC);
+ } else if
(TableUDFUtils.tryGetAggregateFunction(udfInformation.getFunctionName())
+ != null) {
+ return BINARY_MAP.get(FUNCTION_TYPE_USER_DEFINED_AGG_FUNC);
+ } else if
(TableUDFUtils.tryGetTableFunction(udfInformation.getFunctionName()) != null) {
+ return BINARY_MAP.get(FUNCTION_TYPE_USER_DEFINED_TABLE_FUNC);
+ }
Review Comment:
Done~ Store FunctionType in UDFType now.
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/relational/TableBuiltinScalarFunction.java:
##########
@@ -70,4 +75,14 @@ public enum TableBuiltinScalarFunction {
public String getFunctionName() {
return functionName;
}
+
+ private static final Set<String> NATIVE_FUNCTION_NAMES =
Review Comment:
Done
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/relational/TableBuiltinScalarFunction.java:
##########
@@ -70,4 +75,14 @@ public enum TableBuiltinScalarFunction {
public String getFunctionName() {
return functionName;
}
+
+ private static final Set<String> NATIVE_FUNCTION_NAMES =
+ new HashSet<>(
+ Arrays.stream(TableBuiltinScalarFunction.values())
+ .map(TableBuiltinScalarFunction::getFunctionName)
+ .collect(Collectors.toList()));
+
+ public static Set<String> getNativeFunctionNames() {
Review Comment:
Done
--
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]