You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by sh...@apache.org on 2026/04/20 02:20:54 UTC
(iotdb) 01/04: refactor Metadata
This is an automated email from the ASF dual-hosted git repository.
shuwenwei pushed a commit to branch calc_commons
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 0839a5d26758212fe148103f68f072385241a1f6
Author: shuwenwei <s1...@gmail.com>
AuthorDate: Fri Apr 17 17:03:58 2026 +0800
refactor Metadata
---
.../relational/ColumnTransformerBuilder.java | 6 ++--
.../plan/planner/TableOperatorGenerator.java | 10 +++---
.../plan/relational/metadata/ITypeMetadata.java | 29 ++++++++++++++++
.../relational/function/ITableFunctionFactory.java | 28 ++++++++++++++++
.../relational/function/TableFunctionFactory.java | 39 ++++++++++++++++++++++
.../relational/planner/node/AggregationNode.java | 34 -------------------
.../relational/planner/node/TableFunctionNode.java | 4 +--
.../planner/node/TableFunctionProcessorNode.java | 4 +--
.../planner/DataNodeTableOperatorGenerator.java | 2 +-
.../plan/relational/metadata/Metadata.java | 10 ++----
.../relational/metadata/TableMetadataImpl.java | 18 ----------
.../plan/relational/analyzer/TSBSMetadata.java | 5 ---
.../plan/relational/analyzer/TestMetadata.java | 5 ---
13 files changed, 113 insertions(+), 81 deletions(-)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/calc_commons/execution/relational/ColumnTransformerBuilder.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/calc_commons/execution/relational/ColumnTransformerBuilder.java
index 8aeb4d80a4e..0f287136560 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/calc_commons/execution/relational/ColumnTransformerBuilder.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/calc_commons/execution/relational/ColumnTransformerBuilder.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.db.calc_commons.execution.relational;
import org.apache.iotdb.commons.udf.builtin.relational.TableBuiltinScalarFunction;
import org.apache.iotdb.commons.udf.utils.UDFDataTypeTransformer;
+import org.apache.iotdb.db.calc_commons.plan.relational.metadata.ITypeMetadata;
import org.apache.iotdb.db.calc_commons.plan.udf.TableUDFUtils;
import org.apache.iotdb.db.calc_commons.transformation.dag.column.ColumnTransformer;
import org.apache.iotdb.db.calc_commons.transformation.dag.column.FailFunctionColumnTransformer;
@@ -195,7 +196,6 @@ import org.apache.iotdb.db.node_commons.plan.relational.sql.ast.Trim;
import org.apache.iotdb.db.node_commons.plan.relational.sql.ast.WhenClause;
import org.apache.iotdb.db.node_commons.plan.relational.type.InternalTypeManager;
import org.apache.iotdb.db.node_commons.plan.relational.type.TypeNotFoundException;
-import org.apache.iotdb.db.queryengine.plan.relational.metadata.Metadata;
import org.apache.iotdb.udf.api.customizer.analysis.ScalarFunctionAnalysis;
import org.apache.iotdb.udf.api.customizer.parameter.FunctionArguments;
import org.apache.iotdb.udf.api.relational.ScalarFunction;
@@ -1942,7 +1942,7 @@ public class ColumnTransformerBuilder
private final ITableTypeProvider typeProvider;
- private final Metadata metadata;
+ private final ITypeMetadata metadata;
public Context(
SessionInfo sessionInfo,
@@ -1954,7 +1954,7 @@ public class ColumnTransformerBuilder
List<TSDataType> inputDataTypes,
int originSize,
ITableTypeProvider typeProvider,
- Metadata metadata) {
+ ITypeMetadata metadata) {
this.sessionInfo = sessionInfo;
this.leafList = leafList;
this.inputLocations = inputLocations;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/calc_commons/plan/planner/TableOperatorGenerator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/calc_commons/plan/planner/TableOperatorGenerator.java
index eb631cb297a..0d23e34705d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/calc_commons/plan/planner/TableOperatorGenerator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/calc_commons/plan/planner/TableOperatorGenerator.java
@@ -92,6 +92,7 @@ import org.apache.iotdb.db.calc_commons.execution.operator.source.relational.agg
import org.apache.iotdb.db.calc_commons.execution.operator.source.relational.aggregation.grouped.StreamingAggregationOperator;
import org.apache.iotdb.db.calc_commons.execution.operator.source.relational.aggregation.grouped.StreamingHashAggregationOperator;
import org.apache.iotdb.db.calc_commons.execution.relational.ColumnTransformerBuilder;
+import org.apache.iotdb.db.calc_commons.plan.relational.metadata.ITypeMetadata;
import org.apache.iotdb.db.calc_commons.plan.relational.planner.CastToBlobLiteralVisitor;
import org.apache.iotdb.db.calc_commons.plan.relational.planner.CastToBooleanLiteralVisitor;
import org.apache.iotdb.db.calc_commons.plan.relational.planner.CastToDateLiteralVisitor;
@@ -113,6 +114,7 @@ import org.apache.iotdb.db.node_commons.plan.planner.plan.node.process.SingleChi
import org.apache.iotdb.db.node_commons.plan.planner.plan.parameter.InputLocation;
import org.apache.iotdb.db.node_commons.plan.relational.function.BoundSignature;
import org.apache.iotdb.db.node_commons.plan.relational.function.FunctionKind;
+import org.apache.iotdb.db.node_commons.plan.relational.function.ITableFunctionFactory;
import org.apache.iotdb.db.node_commons.plan.relational.metadata.ResolvedFunction;
import org.apache.iotdb.db.node_commons.plan.relational.planner.OrderingScheme;
import org.apache.iotdb.db.node_commons.plan.relational.planner.SortOrder;
@@ -161,7 +163,6 @@ import org.apache.iotdb.db.node_commons.plan.relational.sql.ast.Expression;
import org.apache.iotdb.db.node_commons.plan.relational.sql.ast.Literal;
import org.apache.iotdb.db.node_commons.plan.relational.sql.ast.SymbolReference;
import org.apache.iotdb.db.node_commons.plan.relational.type.InternalTypeManager;
-import org.apache.iotdb.db.queryengine.plan.relational.metadata.Metadata;
import org.apache.iotdb.db.utils.datastructure.SortKey;
import org.apache.iotdb.udf.api.relational.TableFunction;
import org.apache.iotdb.udf.api.relational.table.TableFunctionProcessorProvider;
@@ -233,12 +234,13 @@ import static org.apache.tsfile.read.common.type.StringType.STRING;
import static org.apache.tsfile.read.common.type.TimestampType.TIMESTAMP;
/** This Visitor is responsible for transferring Table PlanNode Tree to Table Operator Tree. */
-public abstract class TableOperatorGenerator<C extends ITableOperatorGeneratorContext>
+public abstract class TableOperatorGenerator<
+ C extends ITableOperatorGeneratorContext, M extends ITypeMetadata & ITableFunctionFactory>
implements ICoreQueryPlanVisitor<Operator, C> {
- protected final Metadata metadata;
+ protected final M metadata;
- public TableOperatorGenerator(Metadata metadata) {
+ public TableOperatorGenerator(M metadata) {
this.metadata = metadata;
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/calc_commons/plan/relational/metadata/ITypeMetadata.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/calc_commons/plan/relational/metadata/ITypeMetadata.java
new file mode 100644
index 00000000000..251a343c8ed
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/calc_commons/plan/relational/metadata/ITypeMetadata.java
@@ -0,0 +1,29 @@
+/*
+ * 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.iotdb.db.calc_commons.plan.relational.metadata;
+
+import org.apache.iotdb.db.node_commons.plan.relational.type.TypeNotFoundException;
+import org.apache.iotdb.db.node_commons.plan.relational.type.TypeSignature;
+
+import org.apache.tsfile.read.common.type.Type;
+
+public interface ITypeMetadata {
+ Type getType(TypeSignature signature) throws TypeNotFoundException;
+}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/function/ITableFunctionFactory.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/function/ITableFunctionFactory.java
new file mode 100644
index 00000000000..9553ddc9fbb
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/function/ITableFunctionFactory.java
@@ -0,0 +1,28 @@
+/*
+ * 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.iotdb.db.node_commons.plan.relational.function;
+
+import org.apache.iotdb.udf.api.relational.TableFunction;
+
+public interface ITableFunctionFactory {
+ default TableFunction getTableFunction(String functionName) {
+ return TableFunctionFactory.getTableFunction(functionName);
+ }
+}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/function/TableFunctionFactory.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/function/TableFunctionFactory.java
new file mode 100644
index 00000000000..75d34ec46e2
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/function/TableFunctionFactory.java
@@ -0,0 +1,39 @@
+/*
+ * 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.iotdb.db.node_commons.plan.relational.function;
+
+import org.apache.iotdb.db.calc_commons.plan.udf.TableUDFUtils;
+import org.apache.iotdb.db.exception.sql.SemanticException;
+import org.apache.iotdb.udf.api.relational.TableFunction;
+
+public class TableFunctionFactory {
+
+ private TableFunctionFactory() {}
+
+ public static TableFunction getTableFunction(String functionName) {
+ if (TableBuiltinTableFunction.isBuiltInTableFunction(functionName)) {
+ return TableBuiltinTableFunction.getBuiltinTableFunction(functionName);
+ } else if (TableUDFUtils.isTableFunction(functionName)) {
+ return TableUDFUtils.getTableFunction(functionName);
+ } else {
+ throw new SemanticException("Unknown function: " + functionName);
+ }
+ }
+}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/planner/node/AggregationNode.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/planner/node/AggregationNode.java
index 05900d8425c..9c1a57dac5e 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/planner/node/AggregationNode.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/planner/node/AggregationNode.java
@@ -19,7 +19,6 @@
package org.apache.iotdb.db.node_commons.plan.relational.planner.node;
-import org.apache.iotdb.db.node_commons.common.SessionInfo;
import org.apache.iotdb.db.node_commons.plan.expression.multi.FunctionType;
import org.apache.iotdb.db.node_commons.plan.planner.plan.node.ICoreQueryPlanVisitor;
import org.apache.iotdb.db.node_commons.plan.planner.plan.node.IPlanVisitor;
@@ -32,7 +31,6 @@ import org.apache.iotdb.db.node_commons.plan.relational.planner.OrderingScheme;
import org.apache.iotdb.db.node_commons.plan.relational.planner.Symbol;
import org.apache.iotdb.db.node_commons.plan.relational.sql.ast.Expression;
import org.apache.iotdb.db.node_commons.plan.relational.sql.ast.SymbolReference;
-import org.apache.iotdb.db.queryengine.plan.relational.metadata.Metadata;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -342,38 +340,6 @@ public class AggregationNode extends SingleChildProcessNode {
&& outputs.containsAll(new HashSet<>(groupingSets.getGroupingKeys()));
}
- public boolean isDecomposable(SessionInfo session, Metadata metadata) {
- boolean hasOrderBy =
- getAggregations().values().stream()
- .map(Aggregation::getOrderingScheme)
- .anyMatch(Optional::isPresent);
-
- boolean hasDistinct = getAggregations().values().stream().anyMatch(Aggregation::isDistinct);
-
- /*boolean decomposableFunctions = getAggregations().values().stream()
- .map(Aggregation::getResolvedFunction)
- .map(resolvedFunction -> metadata.getAggregationFunctionMetadata(session, resolvedFunction))
- .allMatch(AggregationFunctionMetadata::isDecomposable);*/
-
- return !hasOrderBy && !hasDistinct;
- }
-
- public boolean hasSingleNodeExecutionPreference(SessionInfo session, Metadata metadata) {
- // There are two kinds of aggregations the have single node execution preference:
- //
- // 1. aggregations with only empty grouping sets like
- //
- // SELECT count(*) FROM lineitem;
- //
- // there is no need for distributed aggregation. Single node FINAL aggregation will suffice,
- // since all input have to be aggregated into one line output.
- //
- // 2. aggregations that must produce default output and are not decomposable, we cannot
- // distribute them.
- return (hasEmptyGroupingSet() && !hasNonEmptyGroupingSet())
- || (hasDefaultOutput() && !isDecomposable(session, metadata));
- }
-
public boolean isStreamable() {
return !preGroupedSymbols.isEmpty()
&& groupingSets.getGroupingSetCount() == 1
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/planner/node/TableFunctionNode.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/planner/node/TableFunctionNode.java
index f8f79f56c84..3b673ea8738 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/planner/node/TableFunctionNode.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/planner/node/TableFunctionNode.java
@@ -25,9 +25,9 @@ import org.apache.iotdb.db.node_commons.plan.planner.plan.node.PlanNode;
import org.apache.iotdb.db.node_commons.plan.planner.plan.node.PlanNodeId;
import org.apache.iotdb.db.node_commons.plan.planner.plan.node.PlanNodeType;
import org.apache.iotdb.db.node_commons.plan.planner.plan.node.process.MultiChildProcessNode;
+import org.apache.iotdb.db.node_commons.plan.relational.function.TableFunctionFactory;
import org.apache.iotdb.db.node_commons.plan.relational.planner.DataOrganizationSpecification;
import org.apache.iotdb.db.node_commons.plan.relational.planner.Symbol;
-import org.apache.iotdb.db.queryengine.plan.relational.metadata.TableMetadataImpl;
import org.apache.iotdb.udf.api.relational.table.TableFunctionHandle;
import com.google.common.collect.ImmutableList;
@@ -198,7 +198,7 @@ public class TableFunctionNode extends MultiChildProcessNode {
int size = ReadWriteIOUtils.readInt(byteBuffer);
byte[] bytes = ReadWriteIOUtils.readBytes(byteBuffer, size);
TableFunctionHandle tableFunctionHandle =
- new TableMetadataImpl().getTableFunction(name).createTableFunctionHandle();
+ TableFunctionFactory.getTableFunction(name).createTableFunctionHandle();
tableFunctionHandle.deserialize(bytes);
size = ReadWriteIOUtils.readInt(byteBuffer);
ImmutableList.Builder<Symbol> properOutputs = ImmutableList.builder();
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/planner/node/TableFunctionProcessorNode.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/planner/node/TableFunctionProcessorNode.java
index 2f6c2009d51..677e2da553a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/planner/node/TableFunctionProcessorNode.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/node_commons/plan/relational/planner/node/TableFunctionProcessorNode.java
@@ -25,9 +25,9 @@ import org.apache.iotdb.db.node_commons.plan.planner.plan.node.PlanNode;
import org.apache.iotdb.db.node_commons.plan.planner.plan.node.PlanNodeId;
import org.apache.iotdb.db.node_commons.plan.planner.plan.node.PlanNodeType;
import org.apache.iotdb.db.node_commons.plan.planner.plan.node.process.SingleChildProcessNode;
+import org.apache.iotdb.db.node_commons.plan.relational.function.TableFunctionFactory;
import org.apache.iotdb.db.node_commons.plan.relational.planner.DataOrganizationSpecification;
import org.apache.iotdb.db.node_commons.plan.relational.planner.Symbol;
-import org.apache.iotdb.db.queryengine.plan.relational.metadata.TableMetadataImpl;
import org.apache.iotdb.udf.api.relational.table.TableFunctionHandle;
import com.google.common.collect.ImmutableList;
@@ -260,7 +260,7 @@ public class TableFunctionProcessorNode extends SingleChildProcessNode {
size = ReadWriteIOUtils.readInt(byteBuffer);
byte[] bytes = ReadWriteIOUtils.readBytes(byteBuffer, size);
TableFunctionHandle tableFunctionHandle =
- new TableMetadataImpl().getTableFunction(name).createTableFunctionHandle();
+ TableFunctionFactory.getTableFunction(name).createTableFunctionHandle();
tableFunctionHandle.deserialize(bytes);
boolean requireRecordSnapshot = ReadWriteIOUtils.readBoolean(byteBuffer);
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/DataNodeTableOperatorGenerator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/DataNodeTableOperatorGenerator.java
index 48ba79cb922..6aa266ff743 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/DataNodeTableOperatorGenerator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/DataNodeTableOperatorGenerator.java
@@ -197,7 +197,7 @@ import static org.apache.iotdb.db.utils.constant.SqlConstant.SUM;
import static org.apache.tsfile.read.common.type.TimestampType.TIMESTAMP;
public class DataNodeTableOperatorGenerator
- extends TableOperatorGenerator<LocalExecutionPlanContext>
+ extends TableOperatorGenerator<LocalExecutionPlanContext, Metadata>
implements PlanVisitor<Operator, LocalExecutionPlanContext> {
private static final MPPDataExchangeManager MPP_DATA_EXCHANGE_MANAGER =
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/Metadata.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/Metadata.java
index 873c31b5393..0a5cabbd0d3 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/Metadata.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/Metadata.java
@@ -24,18 +24,18 @@ import org.apache.iotdb.commons.partition.DataPartitionQueryParam;
import org.apache.iotdb.commons.partition.SchemaPartition;
import org.apache.iotdb.commons.schema.table.InsertNodeMeasurementInfo;
import org.apache.iotdb.commons.udf.builtin.relational.TableBuiltinWindowFunction;
+import org.apache.iotdb.db.calc_commons.plan.relational.metadata.ITypeMetadata;
import org.apache.iotdb.db.exception.load.LoadAnalyzeTableColumnDisorderException;
import org.apache.iotdb.db.exception.sql.SemanticException;
import org.apache.iotdb.db.node_commons.common.SessionInfo;
+import org.apache.iotdb.db.node_commons.plan.relational.function.ITableFunctionFactory;
import org.apache.iotdb.db.node_commons.plan.relational.function.OperatorType;
import org.apache.iotdb.db.node_commons.plan.relational.sql.ast.Expression;
import org.apache.iotdb.db.node_commons.plan.relational.type.TypeNotFoundException;
import org.apache.iotdb.db.node_commons.plan.relational.type.TypeSignature;
import org.apache.iotdb.db.queryengine.common.MPPQueryContext;
-import org.apache.iotdb.db.queryengine.plan.analyze.IPartitionFetcher;
import org.apache.iotdb.db.queryengine.plan.relational.metadata.fetcher.TableHeaderSchemaValidator;
import org.apache.iotdb.db.queryengine.plan.relational.security.AccessControl;
-import org.apache.iotdb.udf.api.relational.TableFunction;
import org.apache.tsfile.file.metadata.IDeviceID;
import org.apache.tsfile.read.common.type.Type;
@@ -46,7 +46,7 @@ import java.util.Optional;
import java.util.concurrent.atomic.AtomicBoolean;
// All the input databases shall not contain "root"
-public interface Metadata {
+public interface Metadata extends ITypeMetadata, ITableFunctionFactory {
boolean tableExists(final QualifiedObjectName name);
@@ -76,8 +76,6 @@ public interface Metadata {
boolean canCoerce(final Type from, final Type to);
- IPartitionFetcher getPartitionFetcher();
-
/**
* Get all device ids and corresponding attributes from schema region
*
@@ -212,6 +210,4 @@ public interface Metadata {
*/
DataPartition getDataPartitionWithUnclosedTimeRange(
final String database, final List<DataPartitionQueryParam> sgNameToQueryParamsMap);
-
- TableFunction getTableFunction(final String functionName);
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableMetadataImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableMetadataImpl.java
index c6351934348..bef1ea1b484 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableMetadataImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableMetadataImpl.java
@@ -34,7 +34,6 @@ import org.apache.iotdb.db.exception.load.LoadAnalyzeTableColumnDisorderExceptio
import org.apache.iotdb.db.exception.sql.SemanticException;
import org.apache.iotdb.db.node_commons.common.SessionInfo;
import org.apache.iotdb.db.node_commons.plan.relational.function.OperatorType;
-import org.apache.iotdb.db.node_commons.plan.relational.function.TableBuiltinTableFunction;
import org.apache.iotdb.db.node_commons.plan.relational.function.arithmetic.AdditionResolver;
import org.apache.iotdb.db.node_commons.plan.relational.function.arithmetic.DivisionResolver;
import org.apache.iotdb.db.node_commons.plan.relational.function.arithmetic.ModulusResolver;
@@ -59,7 +58,6 @@ import org.apache.iotdb.udf.api.customizer.analysis.ScalarFunctionAnalysis;
import org.apache.iotdb.udf.api.customizer.parameter.FunctionArguments;
import org.apache.iotdb.udf.api.relational.AggregateFunction;
import org.apache.iotdb.udf.api.relational.ScalarFunction;
-import org.apache.iotdb.udf.api.relational.TableFunction;
import org.apache.tsfile.file.metadata.IDeviceID;
import org.apache.tsfile.read.common.type.ObjectType;
@@ -1417,11 +1415,6 @@ public class TableMetadataImpl implements Metadata {
return true;
}
- @Override
- public IPartitionFetcher getPartitionFetcher() {
- return ClusterPartitionFetcher.getInstance();
- }
-
@Override
public Map<String, List<DeviceEntry>> indexScan(
final QualifiedObjectName tableName,
@@ -1516,15 +1509,4 @@ public class TableMetadataImpl implements Metadata {
return partitionFetcher.getDataPartitionWithUnclosedTimeRange(
Collections.singletonMap(database, sgNameToQueryParamsMap));
}
-
- @Override
- public TableFunction getTableFunction(String functionName) {
- if (TableBuiltinTableFunction.isBuiltInTableFunction(functionName)) {
- return TableBuiltinTableFunction.getBuiltinTableFunction(functionName);
- } else if (TableUDFUtils.isTableFunction(functionName)) {
- return TableUDFUtils.getTableFunction(functionName);
- } else {
- throw new SemanticException("Unknown function: " + functionName);
- }
- }
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/TSBSMetadata.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/TSBSMetadata.java
index 2d4f50c3ee2..2eedf5c62e4 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/TSBSMetadata.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/TSBSMetadata.java
@@ -278,11 +278,6 @@ public class TSBSMetadata implements Metadata {
return true;
}
- @Override
- public IPartitionFetcher getPartitionFetcher() {
- return getFakePartitionFetcher();
- }
-
@Override
public Map<String, List<DeviceEntry>> indexScan(
QualifiedObjectName tableName,
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/TestMetadata.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/TestMetadata.java
index f152a9edff2..83ce87c2fe1 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/TestMetadata.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/TestMetadata.java
@@ -318,11 +318,6 @@ public class TestMetadata implements Metadata {
return true;
}
- @Override
- public IPartitionFetcher getPartitionFetcher() {
- return getFakePartitionFetcher();
- }
-
@Override
public Map<String, List<DeviceEntry>> indexScan(
final QualifiedObjectName tableName,