This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 6fac5f248e9 [chore](planner) clear code under analysis package (#60844)
6fac5f248e9 is described below
commit 6fac5f248e989fba503febb673eadf7621db758a
Author: morrySnow <[email protected]>
AuthorDate: Fri Feb 27 12:13:31 2026 +0800
[chore](planner) clear code under analysis package (#60844)
This pull request focuses on code cleanup and refactoring within the
`org.apache.doris.analysis` and `org.apache.doris.nereids.rules.rewrite`
packages. The main changes include the removal of deprecated or unused
classes, increased encapsulation in core classes, and the relocation of
the `AccessPathInfo` class to better reflect its usage. These changes
simplify the codebase, improve maintainability, and reduce unnecessary
dependencies.
**Refactoring and Code Cleanup:**
* Removed deprecated or unused classes: `AlterUserType` and
`ChannelDescription` have been deleted as they are no longer in use.
* Removed unused logging and utility imports, as well as the `toSql()`
method and logger from `BrokerDesc` and `ResourceDesc`, further cleaning
up the code.
**Encapsulation and API Simplification:**
* Increased encapsulation in `AggregateInfo` by making several member
variables private and final where appropriate, reducing their visibility
and potential for misuse.
* Simplified `CopyFromParam` by removing unused fields, methods, and
logic, leaving only the essential constructor and getter for
`stageAndPattern`.
**Class Relocation and Dependency Updates:**
* Moved `AccessPathInfo` from `org.apache.doris.analysis` to
`org.apache.doris.nereids.rules.rewrite`, and updated all references
accordingly to reflect its new location and reduce cross-package
dependencies.
---
.../org/apache/doris/common/FormatOptions.java | 0
.../org/apache/doris/analysis/AggregateInfo.java | 10 +-
.../org/apache/doris/analysis/AlterUserType.java | 29 ---
.../java/org/apache/doris/analysis/BrokerDesc.java | 18 --
.../apache/doris/analysis/ChannelDescription.java | 41 ----
.../org/apache/doris/analysis/CopyFromParam.java | 261 +--------------------
.../org/apache/doris/analysis/ResourceDesc.java | 11 -
.../rewrite/AccessPathExpressionCollector.java | 1 -
.../rules/rewrite}/AccessPathInfo.java | 5 +-
.../rules/rewrite/AccessPathPlanCollector.java | 1 -
.../nereids/rules/rewrite/NestedColumnPruning.java | 1 -
.../nereids/rules/rewrite/SlotTypeReplacer.java | 1 -
.../trees/plans/commands/info/CopyIntoInfo.java | 29 +--
13 files changed, 13 insertions(+), 395 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/common/FormatOptions.java
b/fe/fe-common/src/main/java/org/apache/doris/common/FormatOptions.java
similarity index 100%
rename from fe/fe-core/src/main/java/org/apache/doris/common/FormatOptions.java
rename to fe/fe-common/src/main/java/org/apache/doris/common/FormatOptions.java
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfo.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfo.java
index 64fe979ada5..f1f0c069903 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfo.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfo.java
@@ -30,26 +30,26 @@ public final class AggregateInfo {
// For aggregations: All unique grouping expressions from a select block.
// For analytics: Empty.
- protected ArrayList<Expr> groupingExprs;
+ private final ArrayList<Expr> groupingExprs;
// For aggregations: All unique aggregate expressions from a select block.
// For analytics: The results of AnalyticExpr.getFnCall() for the unique
// AnalyticExprs of a select block.
- protected ArrayList<FunctionCallExpr> aggregateExprs;
+ private final ArrayList<FunctionCallExpr> aggregateExprs;
// The tuple into which the final output of the aggregation is
materialized.
// Contains groupingExprs.size() + aggregateExprs.size() slots, the first
of which
// contain the values of the grouping exprs, followed by slots into which
the
// aggregateExprs' finalize() symbol write its result, i.e., slots of the
aggregate
// functions' output types.
- protected TupleDescriptor outputTupleDesc;
+ private TupleDescriptor outputTupleDesc;
// For aggregation: indices into aggregate exprs for that need to be
materialized
// For analytics: indices into the analytic exprs and their corresponding
aggregate
// exprs that need to be materialized.
// Populated in materializeRequiredSlots() which must be implemented by
subclasses.
- protected ArrayList<Integer> materializedSlots = Lists.newArrayList();
- protected List<String> materializedSlotLabels = Lists.newArrayList();
+ private ArrayList<Integer> materializedSlots = Lists.newArrayList();
+ private List<String> materializedSlotLabels = Lists.newArrayList();
public enum AggPhase {
FIRST,
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterUserType.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterUserType.java
deleted file mode 100644
index 8e27cf679b9..00000000000
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterUserType.java
+++ /dev/null
@@ -1,29 +0,0 @@
-// 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.doris.analysis;
-
-public enum AlterUserType {
- ADD_USER_WHITELIST("add_whiteList"),
- DELETE_USER_WHITELIST("delete_whiteList");
-
- private String type;
-
- private AlterUserType(String type) {
- this.type = type;
- }
-}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/BrokerDesc.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/BrokerDesc.java
index c77937cc8c3..886ce5950e7 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/BrokerDesc.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/BrokerDesc.java
@@ -21,7 +21,6 @@ import org.apache.doris.analysis.StorageBackend.StorageType;
import org.apache.doris.common.UserException;
import org.apache.doris.common.io.Text;
import org.apache.doris.common.io.Writable;
-import org.apache.doris.common.util.PrintableMap;
import org.apache.doris.datasource.property.storage.BrokerProperties;
import org.apache.doris.datasource.property.storage.StorageProperties;
import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
@@ -32,8 +31,6 @@ import com.google.common.collect.Maps;
import com.google.gson.annotations.SerializedName;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import java.io.DataInput;
import java.io.DataOutput;
@@ -49,7 +46,6 @@ import java.util.Map;
// "password" = "password0"
// )
public class BrokerDesc extends StorageDesc implements Writable {
- private static final Logger LOG = LogManager.getLogger(BrokerDesc.class);
// just for multi load
public static final String MULTI_LOAD_BROKER =
"__DORIS_MULTI_LOAD_BROKER__";
@@ -165,18 +161,4 @@ public class BrokerDesc extends StorageDesc implements
Writable {
public static BrokerDesc read(DataInput in) throws IOException {
return GsonUtils.GSON.fromJson(Text.readString(in), BrokerDesc.class);
}
-
- public String toSql() {
- StringBuilder sb = new StringBuilder();
- if (storageType == StorageBackend.StorageType.BROKER) {
- sb.append("WITH BROKER ").append(name);
- } else {
- sb.append("WITH ").append(storageType.name());
- }
- if (properties != null && !properties.isEmpty()) {
- PrintableMap<String, String> printableMap = new
PrintableMap<>(properties, " = ", true, false, true);
- sb.append(" (").append(printableMap.toString()).append(")");
- }
- return sb.toString();
- }
}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/ChannelDescription.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/ChannelDescription.java
deleted file mode 100644
index 904444dc5de..00000000000
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/ChannelDescription.java
+++ /dev/null
@@ -1,41 +0,0 @@
-// 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.doris.analysis;
-
-import org.apache.doris.info.PartitionNamesInfo;
-
-import com.google.gson.annotations.SerializedName;
-
-import java.util.List;
-
-@Deprecated
-public class ChannelDescription {
- @SerializedName(value = "srcDatabase")
- private String srcDatabase;
- @SerializedName(value = "srcTableName")
- private String srcTableName;
- @SerializedName(value = "targetTable")
- private String targetTable;
- @SerializedName(value = "partitionNames")
- private PartitionNamesInfo partitionNames;
- // column names of source table
- @SerializedName(value = "colNames")
- private List<String> colNames;
- @SerializedName(value = "channelId")
- private long channelId;
-}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/CopyFromParam.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/CopyFromParam.java
index eb494a6153d..cb62409856f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/CopyFromParam.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/CopyFromParam.java
@@ -17,274 +17,21 @@
package org.apache.doris.analysis;
-import org.apache.doris.analysis.BinaryPredicate.Operator;
-import org.apache.doris.catalog.Column;
-import org.apache.doris.catalog.Database;
-import org.apache.doris.catalog.Env;
-import org.apache.doris.catalog.KeysType;
-import org.apache.doris.catalog.OlapTable;
-import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.ErrorCode;
-import org.apache.doris.common.ErrorReport;
-import org.apache.doris.info.TableNameInfo;
-
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import lombok.Getter;
-import lombok.Setter;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
/**
* CopyFromParam
*/
public class CopyFromParam {
- private static final Logger LOG =
LogManager.getLogger(CopyFromParam.class);
- private static final String DOLLAR = "$";
- @Getter
- private StageAndPattern stageAndPattern;
- @Getter
- private List<Expr> exprList;
- @Getter
- private Expr fileFilterExpr;
- @Getter
- private List<String> fileColumns;
- @Getter
- private List<Expr> columnMappingList;
- @Setter
- private List<String> targetColumns;
-
- public CopyFromParam(StageAndPattern stageAndPattern) {
- this.stageAndPattern = stageAndPattern;
- }
-
- public CopyFromParam(StageAndPattern stageAndPattern, List<Expr> exprList,
Expr whereExpr) {
- this.stageAndPattern = stageAndPattern;
- this.exprList = exprList;
- this.fileFilterExpr = whereExpr;
- }
+ private final StageAndPattern stageAndPattern;
/**
* CopyFromParam
*/
- public CopyFromParam(StageAndPattern stageAndPattern, List<Expr> exprList,
Expr fileFilterExpr,
- List<String> fileColumns, List<Expr>
columnMappingList, List<String> targetColumns) {
+ public CopyFromParam(StageAndPattern stageAndPattern) {
this.stageAndPattern = stageAndPattern;
- this.exprList = exprList;
- this.fileFilterExpr = fileFilterExpr;
- this.fileColumns = fileColumns;
- this.columnMappingList = columnMappingList;
- this.targetColumns = targetColumns;
}
- /**
- * analyze
- */
- public void analyze(String fullDbName, TableNameInfo tableName, boolean
useDeleteSign, String fileType)
- throws AnalysisException {
- if (exprList == null && fileFilterExpr == null && !useDeleteSign) {
- return;
- }
- this.fileColumns = new ArrayList<>();
- this.columnMappingList = new ArrayList<>();
-
- Database db =
Env.getCurrentInternalCatalog().getDbOrAnalysisException(fullDbName);
- OlapTable olapTable =
db.getOlapTableOrAnalysisException(tableName.getTbl());
-
- if (useDeleteSign && olapTable.getKeysType() != KeysType.UNIQUE_KEYS) {
- throw new AnalysisException("copy.use_delete_sign property only
support unique table");
- }
-
- // Analyze table columns mentioned in the statement.
- boolean addDeleteSign = false;
- if (targetColumns == null) {
- targetColumns = new ArrayList<>();
- for (Column col : olapTable.getBaseSchema(false)) {
- targetColumns.add(col.getName());
- }
- if (useDeleteSign) {
- targetColumns.add(getDeleteSignColumn(olapTable).getName());
- addDeleteSign = true;
- }
- } else {
- if (exprList == null || targetColumns.size() != exprList.size()) {
-
ErrorReport.reportAnalysisException(ErrorCode.ERR_WRONG_VALUE_COUNT);
- }
- Set<String> mentionedColumns =
Sets.newTreeSet(String.CASE_INSENSITIVE_ORDER);
- for (String colName : targetColumns) {
- Column col = olapTable.getColumn(colName);
- if (col == null) {
-
ErrorReport.reportAnalysisException(ErrorCode.ERR_BAD_FIELD_ERROR, colName,
olapTable.getName());
- }
- if (!mentionedColumns.add(colName)) {
-
ErrorReport.reportAnalysisException(ErrorCode.ERR_FIELD_SPECIFIED_TWICE,
colName);
- }
- }
- if (useDeleteSign &&
!mentionedColumns.contains(Column.DELETE_SIGN)) {
- targetColumns.add(getDeleteSignColumn(olapTable).getName());
- addDeleteSign = true;
- }
- }
-
- if (!getFileColumnNames(addDeleteSign)) {
- if (fileType == null || fileType.equalsIgnoreCase("csv")) {
- int maxFileColumnId = getMaxFileColumnId();
- if (useDeleteSign && exprList == null &&
fileColumns.isEmpty()) {
- maxFileColumnId = targetColumns.size() > maxFileColumnId ?
targetColumns.size() : maxFileColumnId;
- }
- for (int i = 1; i <= maxFileColumnId; i++) {
- fileColumns.add(DOLLAR + i);
- }
- } else {
- for (Column col : olapTable.getBaseSchema(false)) {
- fileColumns.add(col.getName());
- }
- if (useDeleteSign) {
- fileColumns.add(getDeleteSignColumn(olapTable).getName());
- }
- }
- }
-
- parseColumnNames(fileType, targetColumns);
- parseColumnNames(fileType, fileColumns);
-
- if (exprList != null) {
- if (targetColumns.size() != exprList.size()) {
-
ErrorReport.reportAnalysisException(ErrorCode.ERR_WRONG_VALUE_COUNT);
- }
- for (int i = 0; i < targetColumns.size(); i++) {
- Expr expr = exprList.get(i);
- BinaryPredicate binaryPredicate = new
BinaryPredicate(Operator.EQ,
- new SlotRef(null, targetColumns.get(i)), expr);
- columnMappingList.add(binaryPredicate);
- }
- } else {
- for (int i = 0; i < targetColumns.size(); i++) {
- // If file column name equals target column name, don't need
to add to
- // columnMapping List. Otherwise it will result in
invalidation of strict
- // mode. Because if the src data is an expr, strict mode
judgment will
- // not be performed.
- if
(!fileColumns.get(i).equalsIgnoreCase(targetColumns.get(i))) {
- BinaryPredicate binaryPredicate = new
BinaryPredicate(Operator.EQ,
- new SlotRef(null, targetColumns.get(i)),
- new SlotRef(null, fileColumns.get(i)));
- columnMappingList.add(binaryPredicate);
- }
- }
- }
- }
-
- // expr use column name
- private boolean getFileColumnNames(boolean addDeleteSign) throws
AnalysisException {
- if (exprList == null) {
- return false;
- }
- List<SlotRef> slotRefs = Lists.newArrayList();
- Expr.collectList(exprList, SlotRef.class, slotRefs);
- Set<String> columnSet = Sets.newTreeSet(String.CASE_INSENSITIVE_ORDER);
- for (SlotRef slotRef : slotRefs) {
- String columnName = slotRef.getColumnName();
- if (columnName.startsWith(DOLLAR)) {
- if (fileColumns.size() > 0) {
- throw new AnalysisException("can not mix column name and
dollar sign");
- }
- return false;
- }
- if (columnSet.add(columnName)) {
- fileColumns.add(columnName);
- }
- }
- if (addDeleteSign) {
- exprList.add(new SlotRef(null, Column.DELETE_SIGN));
- fileColumns.add(Column.DELETE_SIGN);
- }
- return true;
- }
-
- private Column getDeleteSignColumn(OlapTable olapTable) throws
AnalysisException {
- for (Column column : olapTable.getFullSchema()) {
- if (column.isDeleteSignColumn()) {
- return column;
- }
- }
- throw new AnalysisException("Can not find DeleteSignColumn for unique
table");
- }
-
- private int getMaxFileColumnId() throws AnalysisException {
- int maxId = 0;
- if (exprList != null) {
- int maxFileColumnId = getMaxFileColumnId(exprList);
- maxId = maxId > maxFileColumnId ? maxId : maxFileColumnId;
- }
- if (fileFilterExpr != null) {
- int maxFileColumnId =
getMaxFileColumnId(Lists.newArrayList(fileFilterExpr));
- maxId = maxId > maxFileColumnId ? maxId : maxFileColumnId;
- }
- return maxId;
- }
-
- private int getMaxFileColumnId(List<Expr> exprList) throws
AnalysisException {
- List<SlotRef> slotRefs = Lists.newArrayList();
- Expr.collectList(exprList, SlotRef.class, slotRefs);
- int maxId = 0;
- for (SlotRef slotRef : slotRefs) {
- int fileColumnId = getFileColumnIdOfSlotRef(slotRef);
- maxId = fileColumnId < maxId ? maxId : fileColumnId;
- }
- return maxId;
- }
-
- private int getFileColumnIdOfSlotRef(SlotRef slotRef) throws
AnalysisException {
- String columnName = slotRef.getColumnName();
- try {
- if (!columnName.startsWith(DOLLAR)) {
- throw new AnalysisException("can not mix column name and
dollar sign");
- }
- return Integer.parseInt(columnName.substring(1));
- } catch (NumberFormatException e) {
- throw new AnalysisException("column name: " + columnName + " can
not parse to a number");
- }
- }
-
- private void parseColumnNames(String fileType, List<String> columns) {
- // In Be, parquet and orc column names are case-insensitive, but there
is a bug for hidden columns,
- // so handle it temporary.
- if (columns != null && fileType != null &&
(fileType.equalsIgnoreCase("parquet") || fileType.equalsIgnoreCase(
- "orc"))) {
- for (int i = 0; i < columns.size(); i++) {
- if (columns.get(i).equals(Column.DELETE_SIGN)) {
- columns.set(i, Column.DELETE_SIGN.toLowerCase());
- }
- }
- }
- }
-
- /**
- * toSql
- */
- public String toSql() {
- StringBuilder sb = new StringBuilder();
- if (columnMappingList != null || fileFilterExpr != null) {
- sb.append("(SELECT ");
- if (columnMappingList != null) {
- Joiner.on(", ").appendTo(sb,
- Lists.transform(columnMappingList, (Function<Expr,
Object>) expr -> expr.toSql()));
- }
- sb.append(" FROM ").append(stageAndPattern.toSql());
- if (fileFilterExpr != null) {
- sb.append(" WHERE ").append(fileFilterExpr.toSql());
- }
- sb.append(")");
- } else {
- sb.append(stageAndPattern.toSql());
- }
- return sb.toString();
+ public StageAndPattern getStageAndPattern() {
+ return stageAndPattern;
}
}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/ResourceDesc.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/ResourceDesc.java
index 57fa60c3b15..ad4bf290c93 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/ResourceDesc.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/ResourceDesc.java
@@ -20,7 +20,6 @@ package org.apache.doris.analysis;
import org.apache.doris.catalog.Env;
import org.apache.doris.catalog.Resource;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.util.PrintableMap;
import org.apache.doris.load.EtlJobType;
import com.google.common.collect.Maps;
@@ -83,14 +82,4 @@ public class ResourceDesc {
throw new AnalysisException("Spark Resource is no longer
supported");
}
}
-
- public String toSql() {
- StringBuilder sb = new StringBuilder();
- sb.append("WITH RESOURCE '").append(name).append("'");
- if (properties != null && !properties.isEmpty()) {
- PrintableMap<String, String> printableMap = new
PrintableMap<>(properties, " = ", true, false, true);
- sb.append(" (").append(printableMap.toString()).append(")");
- }
- return sb.toString();
- }
}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathExpressionCollector.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathExpressionCollector.java
index dcfcce4cf4e..1ec2711f52b 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathExpressionCollector.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathExpressionCollector.java
@@ -17,7 +17,6 @@
package org.apache.doris.nereids.rules.rewrite;
-import org.apache.doris.analysis.AccessPathInfo;
import org.apache.doris.nereids.StatementContext;
import
org.apache.doris.nereids.rules.rewrite.AccessPathExpressionCollector.CollectorContext;
import
org.apache.doris.nereids.rules.rewrite.NestedColumnPruning.DataTypeAccessTree;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/AccessPathInfo.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathInfo.java
similarity index 92%
rename from
fe/fe-core/src/main/java/org/apache/doris/analysis/AccessPathInfo.java
rename to
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathInfo.java
index a2db1038a32..2b9a34c21a6 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/AccessPathInfo.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathInfo.java
@@ -14,11 +14,8 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-// This file is copied from
-//
https://github.com/apache/impala/blob/branch-2.9.0/fe/src/main/java/org/apache/impala/TupleDescriptor.java
-// and modified by Doris
-package org.apache.doris.analysis;
+package org.apache.doris.nereids.rules.rewrite;
import org.apache.doris.nereids.types.DataType;
import org.apache.doris.thrift.TColumnAccessPath;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathPlanCollector.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathPlanCollector.java
index 48886c0773e..12627ebc181 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathPlanCollector.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathPlanCollector.java
@@ -17,7 +17,6 @@
package org.apache.doris.nereids.rules.rewrite;
-import org.apache.doris.analysis.AccessPathInfo;
import org.apache.doris.nereids.StatementContext;
import
org.apache.doris.nereids.rules.rewrite.AccessPathExpressionCollector.CollectAccessPathResult;
import
org.apache.doris.nereids.rules.rewrite.AccessPathExpressionCollector.CollectorContext;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NestedColumnPruning.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NestedColumnPruning.java
index 016289ac139..620424f2ef3 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NestedColumnPruning.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NestedColumnPruning.java
@@ -17,7 +17,6 @@
package org.apache.doris.nereids.rules.rewrite;
-import org.apache.doris.analysis.AccessPathInfo;
import org.apache.doris.common.Pair;
import org.apache.doris.nereids.StatementContext;
import org.apache.doris.nereids.exceptions.AnalysisException;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/SlotTypeReplacer.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/SlotTypeReplacer.java
index 7f34fe90f7e..d9aa84f7ca8 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/SlotTypeReplacer.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/SlotTypeReplacer.java
@@ -17,7 +17,6 @@
package org.apache.doris.nereids.rules.rewrite;
-import org.apache.doris.analysis.AccessPathInfo;
import org.apache.doris.catalog.Column;
import org.apache.doris.common.Pair;
import org.apache.doris.datasource.iceberg.IcebergExternalTable;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CopyIntoInfo.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CopyIntoInfo.java
index 234fdc67245..0390c445aef 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CopyIntoInfo.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CopyIntoInfo.java
@@ -298,35 +298,12 @@ public class CopyIntoInfo {
}
// translate copy from description to copy from param
- legacyCopyFromParam = toLegacyParam(copyFromDesc, analyzer, context,
cascadesContext);
+ legacyCopyFromParam = toLegacyParam(copyFromDesc);
}
- private CopyFromParam toLegacyParam(CopyFromDesc copyFromDesc,
ExpressionAnalyzer analyzer,
- PlanTranslatorContext context,
CascadesContext cascadesContext) {
+ private CopyFromParam toLegacyParam(CopyFromDesc copyFromDesc) {
StageAndPattern stageAndPattern = copyFromDesc.getStageAndPattern();
- List<Expr> exprList = null;
- if (copyFromDesc.getExprList() != null) {
- exprList = new ArrayList<>();
- for (Expression expression : copyFromDesc.getExprList()) {
- exprList.add(translateToLegacyExpr(expression, analyzer,
context, cascadesContext));
- }
- }
- Expr fileFilterExpr = null;
- if (copyFromDesc.getFileFilterExpr().isPresent()) {
- fileFilterExpr =
translateToLegacyExpr(copyFromDesc.getFileFilterExpr().get(),
- analyzer, context, cascadesContext);
- }
- List<String> fileColumns = copyFromDesc.getFileColumns();
- List<Expr> columnMappingList = null;
- if (copyFromDesc.getColumnMappingList() != null) {
- columnMappingList = new ArrayList<>();
- for (Expression expression : copyFromDesc.getColumnMappingList()) {
- columnMappingList.add(translateToLegacyExpr(expression,
analyzer, context, cascadesContext));
- }
- }
- List<String> targetColumns = copyFromDesc.getTargetColumns();
- return new CopyFromParam(stageAndPattern, exprList, fileFilterExpr,
fileColumns, columnMappingList,
- targetColumns);
+ return new CopyFromParam(stageAndPattern);
}
private Expr translateToLegacyExpr(Expression expr, ExpressionAnalyzer
analyzer, PlanTranslatorContext context,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]