This is an automated email from the ASF dual-hosted git repository. huajianlan pushed a commit to branch nested_column_prune in repository https://gitbox.apache.org/repos/asf/doris.git
commit 853ef4c34a7cfee1ce71567ade9ebb8d0a0a3c8b Author: 924060929 <[email protected]> AuthorDate: Thu Oct 30 18:08:44 2025 +0800 only support prune olapTable/iceberg/hive(parquet/orc) --- .../doris/datasource/hive/HMSExternalTable.java | 40 +++++++++++++++++++++ .../doris/datasource/hive/source/HiveScanNode.java | 37 +------------------ .../nereids/rules/rewrite/SlotTypeReplacer.java | 11 ++++++ .../trees/expressions/functions/table/File.java | 8 ++++- .../trees/expressions/functions/table/Hdfs.java | 9 ++++- .../trees/expressions/functions/table/Local.java | 9 ++++- .../trees/expressions/functions/table/S3.java | 9 ++++- .../trees/plans/logical/LogicalFileScan.java | 31 +++++++++++++++- .../trees/plans/logical/LogicalOlapScan.java | 7 +++- .../plans/logical/SupportPruneNestedColumn.java | 24 +++++++++++++ .../logical/SupportPruneNestedColumnFormats.java | 42 ++++++++++++++++++++++ 11 files changed, 185 insertions(+), 42 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java index babbb099372..526b4c3d071 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java @@ -58,6 +58,7 @@ import org.apache.doris.mtmv.MTMVSnapshotIf; import org.apache.doris.nereids.exceptions.NotSupportedException; import org.apache.doris.nereids.trees.plans.logical.LogicalFileScan.SelectedPartitions; import org.apache.doris.qe.GlobalVariable; +import org.apache.doris.qe.SessionVariable; import org.apache.doris.statistics.AnalysisInfo; import org.apache.doris.statistics.BaseAnalysisTask; import org.apache.doris.statistics.ColumnStatistic; @@ -65,6 +66,7 @@ import org.apache.doris.statistics.ColumnStatisticBuilder; import org.apache.doris.statistics.HMSAnalysisTask; import org.apache.doris.statistics.StatsType; import org.apache.doris.statistics.util.StatisticsUtil; +import org.apache.doris.thrift.TFileFormatType; import org.apache.doris.thrift.THiveTable; import org.apache.doris.thrift.TTableDescriptor; import org.apache.doris.thrift.TTableType; @@ -1188,6 +1190,44 @@ public class HMSExternalTable extends ExternalTable implements MTMVRelatedTableI } } + public TFileFormatType getFileFormatType(SessionVariable sessionVariable) throws UserException { + TFileFormatType type = null; + Table table = getRemoteTable(); + String inputFormatName = table.getSd().getInputFormat(); + String hiveFormat = HiveMetaStoreClientHelper.HiveFileFormat.getFormat(inputFormatName); + if (hiveFormat.equals(HiveMetaStoreClientHelper.HiveFileFormat.PARQUET.getDesc())) { + type = TFileFormatType.FORMAT_PARQUET; + } else if (hiveFormat.equals(HiveMetaStoreClientHelper.HiveFileFormat.ORC.getDesc())) { + type = TFileFormatType.FORMAT_ORC; + } else if (hiveFormat.equals(HiveMetaStoreClientHelper.HiveFileFormat.TEXT_FILE.getDesc())) { + String serDeLib = table.getSd().getSerdeInfo().getSerializationLib(); + if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_JSON_SERDE) + || serDeLib.equals(HiveMetaStoreClientHelper.LEGACY_HIVE_JSON_SERDE)) { + type = TFileFormatType.FORMAT_JSON; + } else if (serDeLib.equals(HiveMetaStoreClientHelper.OPENX_JSON_SERDE)) { + if (!sessionVariable.isReadHiveJsonInOneColumn()) { + type = TFileFormatType.FORMAT_JSON; + } else if (sessionVariable.isReadHiveJsonInOneColumn() && firstColumnIsString()) { + type = TFileFormatType.FORMAT_CSV_PLAIN; + } else { + throw new UserException("You set read_hive_json_in_one_column = true, but the first column of " + + "table " + getName() + + " is not a string column."); + } + } else if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_TEXT_SERDE)) { + type = TFileFormatType.FORMAT_TEXT; + } else if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_OPEN_CSV_SERDE)) { + type = TFileFormatType.FORMAT_CSV_PLAIN; + } else if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_MULTI_DELIMIT_SERDE)) { + type = TFileFormatType.FORMAT_TEXT; + } else { + throw new UserException("Unsupported hive table serde: " + serDeLib); + } + } + return type; + } + + private Table loadHiveTable() { HMSCachedClient client = ((HMSExternalCatalog) catalog).getClient(); return client.getTable(getRemoteDbName(), remoteName); diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java index a11dc6d247e..2a524a4138d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java @@ -409,44 +409,9 @@ public class HiveScanNode extends FileQueryScanNode { @Override public TFileFormatType getFileFormatType() throws UserException { - TFileFormatType type = null; - Table table = hmsTable.getRemoteTable(); - String inputFormatName = table.getSd().getInputFormat(); - String hiveFormat = HiveMetaStoreClientHelper.HiveFileFormat.getFormat(inputFormatName); - if (hiveFormat.equals(HiveMetaStoreClientHelper.HiveFileFormat.PARQUET.getDesc())) { - type = TFileFormatType.FORMAT_PARQUET; - } else if (hiveFormat.equals(HiveMetaStoreClientHelper.HiveFileFormat.ORC.getDesc())) { - type = TFileFormatType.FORMAT_ORC; - } else if (hiveFormat.equals(HiveMetaStoreClientHelper.HiveFileFormat.TEXT_FILE.getDesc())) { - String serDeLib = table.getSd().getSerdeInfo().getSerializationLib(); - if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_JSON_SERDE) - || serDeLib.equals(HiveMetaStoreClientHelper.LEGACY_HIVE_JSON_SERDE)) { - type = TFileFormatType.FORMAT_JSON; - } else if (serDeLib.equals(HiveMetaStoreClientHelper.OPENX_JSON_SERDE)) { - if (!sessionVariable.isReadHiveJsonInOneColumn()) { - type = TFileFormatType.FORMAT_JSON; - } else if (sessionVariable.isReadHiveJsonInOneColumn() - && hmsTable.firstColumnIsString()) { - type = TFileFormatType.FORMAT_CSV_PLAIN; - } else { - throw new UserException("You set read_hive_json_in_one_column = true, but the first column of " - + "table " + hmsTable.getName() - + " is not a string column."); - } - } else if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_TEXT_SERDE)) { - type = TFileFormatType.FORMAT_TEXT; - } else if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_OPEN_CSV_SERDE)) { - type = TFileFormatType.FORMAT_CSV_PLAIN; - } else if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_MULTI_DELIMIT_SERDE)) { - type = TFileFormatType.FORMAT_TEXT; - } else { - throw new UserException("Unsupported hive table serde: " + serDeLib); - } - } - return type; + return hmsTable.getFileFormatType(sessionVariable); } - @Override protected void setScanParams(TFileRangeDesc rangeDesc, Split split) { if (split instanceof HiveSplit) { 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 459c7362758..9ce5de48061 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 @@ -32,6 +32,7 @@ import org.apache.doris.nereids.trees.expressions.Slot; import org.apache.doris.nereids.trees.expressions.SlotReference; import org.apache.doris.nereids.trees.expressions.functions.Function; import org.apache.doris.nereids.trees.expressions.functions.scalar.Lambda; +import org.apache.doris.nereids.trees.expressions.functions.table.TableValuedFunction; import org.apache.doris.nereids.trees.plans.Plan; import org.apache.doris.nereids.trees.plans.logical.LogicalAggregate; import org.apache.doris.nereids.trees.plans.logical.LogicalCTEConsumer; @@ -56,6 +57,7 @@ import org.apache.doris.nereids.trees.plans.logical.LogicalTVFRelation; import org.apache.doris.nereids.trees.plans.logical.LogicalTopN; import org.apache.doris.nereids.trees.plans.logical.LogicalUnion; import org.apache.doris.nereids.trees.plans.logical.LogicalWindow; +import org.apache.doris.nereids.trees.plans.logical.SupportPruneNestedColumn; import org.apache.doris.nereids.trees.plans.visitor.DefaultPlanRewriter; import org.apache.doris.nereids.types.ArrayType; import org.apache.doris.nereids.types.DataType; @@ -374,6 +376,10 @@ public class SlotTypeReplacer extends DefaultPlanRewriter<Void> { @Override public Plan visitLogicalFileScan(LogicalFileScan fileScan, Void context) { + if (!fileScan.supportPruneNestedColumn()) { + return fileScan; + } + Pair<Boolean, List<Slot>> replaced = replaceExpressions(fileScan.getOutput(), false, true); if (replaced.first) { List<Slot> replaceSlots = new ArrayList<>(replaced.second); @@ -407,6 +413,11 @@ public class SlotTypeReplacer extends DefaultPlanRewriter<Void> { @Override public Plan visitLogicalTVFRelation(LogicalTVFRelation tvfRelation, Void context) { + TableValuedFunction function = tvfRelation.getFunction(); + if (!(function instanceof SupportPruneNestedColumn) + || !((SupportPruneNestedColumn) function).supportPruneNestedColumn()) { + return tvfRelation; + } Pair<Boolean, List<Slot>> replaced = replaceExpressions(tvfRelation.getOutput(), false, true); if (replaced.first) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/File.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/File.java index aed17d7b5a8..660dfad4874 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/File.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/File.java @@ -21,6 +21,8 @@ import org.apache.doris.catalog.FunctionSignature; import org.apache.doris.nereids.exceptions.AnalysisException; import org.apache.doris.nereids.trees.expressions.Properties; import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor; +import org.apache.doris.nereids.trees.plans.logical.SupportPruneNestedColumn; +import org.apache.doris.nereids.trees.plans.logical.SupportPruneNestedColumnFormats; import org.apache.doris.nereids.types.coercion.AnyDataType; import org.apache.doris.tablefunction.FileTableValuedFunction; import org.apache.doris.tablefunction.TableValuedFunctionIf; @@ -30,7 +32,7 @@ import java.util.Map; /** * File Tvf */ -public class File extends TableValuedFunction { +public class File extends TableValuedFunction implements SupportPruneNestedColumn { public File(Properties properties) { super("file", properties); } @@ -55,4 +57,8 @@ public class File extends TableValuedFunction { return visitor.visitFile(this, context); } + @Override + public boolean supportPruneNestedColumn() { + return SupportPruneNestedColumnFormats.supportFormat(getTVFProperties()); + } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/Hdfs.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/Hdfs.java index 5f8651ed61c..8389892f6cf 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/Hdfs.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/Hdfs.java @@ -21,6 +21,8 @@ import org.apache.doris.catalog.FunctionSignature; import org.apache.doris.nereids.exceptions.AnalysisException; import org.apache.doris.nereids.trees.expressions.Properties; import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor; +import org.apache.doris.nereids.trees.plans.logical.SupportPruneNestedColumn; +import org.apache.doris.nereids.trees.plans.logical.SupportPruneNestedColumnFormats; import org.apache.doris.nereids.types.coercion.AnyDataType; import org.apache.doris.tablefunction.HdfsTableValuedFunction; import org.apache.doris.tablefunction.TableValuedFunctionIf; @@ -29,7 +31,7 @@ import java.util.List; import java.util.Map; /** hdfs */ -public class Hdfs extends TableValuedFunction { +public class Hdfs extends TableValuedFunction implements SupportPruneNestedColumn { public Hdfs(Properties properties) { super("hdfs", properties); } @@ -53,4 +55,9 @@ public class Hdfs extends TableValuedFunction { public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) { return visitor.visitHdfs(this, context); } + + @Override + public boolean supportPruneNestedColumn() { + return SupportPruneNestedColumnFormats.supportFormat(getTVFProperties()); + } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/Local.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/Local.java index 4330980ee86..094324e895b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/Local.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/Local.java @@ -21,6 +21,8 @@ import org.apache.doris.catalog.FunctionSignature; import org.apache.doris.nereids.exceptions.AnalysisException; import org.apache.doris.nereids.trees.expressions.Properties; import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor; +import org.apache.doris.nereids.trees.plans.logical.SupportPruneNestedColumn; +import org.apache.doris.nereids.trees.plans.logical.SupportPruneNestedColumnFormats; import org.apache.doris.nereids.types.coercion.AnyDataType; import org.apache.doris.tablefunction.LocalTableValuedFunction; import org.apache.doris.tablefunction.TableValuedFunctionIf; @@ -30,7 +32,7 @@ import java.util.Map; /** * local */ -public class Local extends TableValuedFunction { +public class Local extends TableValuedFunction implements SupportPruneNestedColumn { public Local(Properties properties) { super("local", properties); } @@ -54,4 +56,9 @@ public class Local extends TableValuedFunction { public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) { return visitor.visitLocal(this, context); } + + @Override + public boolean supportPruneNestedColumn() { + return SupportPruneNestedColumnFormats.supportFormat(getTVFProperties()); + } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/S3.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/S3.java index d2623d8fd3c..3c4c924d7f4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/S3.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/table/S3.java @@ -21,6 +21,8 @@ import org.apache.doris.catalog.FunctionSignature; import org.apache.doris.nereids.exceptions.AnalysisException; import org.apache.doris.nereids.trees.expressions.Properties; import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor; +import org.apache.doris.nereids.trees.plans.logical.SupportPruneNestedColumn; +import org.apache.doris.nereids.trees.plans.logical.SupportPruneNestedColumnFormats; import org.apache.doris.nereids.types.coercion.AnyDataType; import org.apache.doris.tablefunction.S3TableValuedFunction; import org.apache.doris.tablefunction.TableValuedFunctionIf; @@ -28,7 +30,7 @@ import org.apache.doris.tablefunction.TableValuedFunctionIf; import java.util.Map; /** s3 */ -public class S3 extends TableValuedFunction { +public class S3 extends TableValuedFunction implements SupportPruneNestedColumn { public S3(Properties properties) { super("s3", properties); } @@ -52,4 +54,9 @@ public class S3 extends TableValuedFunction { public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) { return visitor.visitS3(this, context); } + + @Override + public boolean supportPruneNestedColumn() { + return SupportPruneNestedColumnFormats.supportFormat(getTVFProperties()); + } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalFileScan.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalFileScan.java index 8854800005e..5d4c1167a82 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalFileScan.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalFileScan.java @@ -21,6 +21,8 @@ import org.apache.doris.analysis.TableScanParams; import org.apache.doris.analysis.TableSnapshot; import org.apache.doris.catalog.PartitionItem; import org.apache.doris.datasource.ExternalTable; +import org.apache.doris.datasource.hive.HMSExternalTable; +import org.apache.doris.datasource.iceberg.IcebergExternalTable; import org.apache.doris.datasource.mvcc.MvccUtil; import org.apache.doris.nereids.memo.GroupExpression; import org.apache.doris.nereids.properties.LogicalProperties; @@ -32,6 +34,9 @@ import org.apache.doris.nereids.trees.plans.PlanType; import org.apache.doris.nereids.trees.plans.RelationId; import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor; import org.apache.doris.nereids.util.Utils; +import org.apache.doris.qe.ConnectContext; +import org.apache.doris.qe.SessionVariable; +import org.apache.doris.thrift.TFileFormatType; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; @@ -46,7 +51,7 @@ import java.util.Optional; /** * Logical file scan for external catalog. */ -public class LogicalFileScan extends LogicalCatalogRelation { +public class LogicalFileScan extends LogicalCatalogRelation implements SupportPruneNestedColumn { protected final SelectedPartitions selectedPartitions; protected final Optional<TableSample> tableSample; protected final Optional<TableSnapshot> tableSnapshot; @@ -189,6 +194,30 @@ public class LogicalFileScan extends LogicalCatalogRelation { return super.computeAsteriskOutput(); } + @Override + public boolean supportPruneNestedColumn() { + ExternalTable table = getTable(); + if (table instanceof IcebergExternalTable) { + return true; + } else if (table instanceof HMSExternalTable) { + try { + ConnectContext connectContext = ConnectContext.get(); + SessionVariable sessionVariable = connectContext.getSessionVariable(); + TFileFormatType fileFormatType = ((HMSExternalTable) table).getFileFormatType(sessionVariable); + switch (fileFormatType) { + case FORMAT_PARQUET: + case FORMAT_ORC: + return true; + default: + return false; + } + } catch (Throwable t) { + // ignore and not prune + } + } + return false; + } + /** * SelectedPartitions contains the selected partitions and the total partition number. * Mainly for hive table partition pruning. diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java index 394e414cc2e..cb1214cd7c5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java @@ -72,7 +72,7 @@ import java.util.stream.Collectors; /** * Logical OlapScan. */ -public class LogicalOlapScan extends LogicalCatalogRelation implements OlapScan { +public class LogicalOlapScan extends LogicalCatalogRelation implements OlapScan, SupportPruneNestedColumn { private static final Logger LOG = LogManager.getLogger(LogicalOlapScan.class); @@ -868,4 +868,9 @@ public class LogicalOlapScan extends LogicalCatalogRelation implements OlapScan manuallySpecifiedTabletIds, operativeSlots, virtualColumns, scoreOrderKeys, scoreLimit, annOrderKeys, annLimit, tableAlias); } + + @Override + public boolean supportPruneNestedColumn() { + return true; + } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/SupportPruneNestedColumn.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/SupportPruneNestedColumn.java new file mode 100644 index 00000000000..44f1b733dd1 --- /dev/null +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/SupportPruneNestedColumn.java @@ -0,0 +1,24 @@ +// 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.nereids.trees.plans.logical; + +/** SupportPruneNestedColumn */ +public interface SupportPruneNestedColumn { + // return false will not prune the nested column + boolean supportPruneNestedColumn(); +} diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/SupportPruneNestedColumnFormats.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/SupportPruneNestedColumnFormats.java new file mode 100644 index 00000000000..a9ee8f64b49 --- /dev/null +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/SupportPruneNestedColumnFormats.java @@ -0,0 +1,42 @@ +// 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.nereids.trees.plans.logical; + +import org.apache.doris.nereids.trees.expressions.Properties; + +import com.google.common.collect.ImmutableSet; + +import java.util.Map.Entry; +import java.util.Set; + +/** SupportPruneNestedColumnFormats */ +public class SupportPruneNestedColumnFormats { + private static final Set<String> SUPPORTED_FORMATS = ImmutableSet.of( + "parquet", "orc" + ); + + /** supportFormat */ + public static boolean supportFormat(Properties properties) { + for (Entry<String, String> kv : properties.getMap().entrySet()) { + if (kv.getKey().equalsIgnoreCase("format")) { + return SUPPORTED_FORMATS.contains(kv.getValue().toLowerCase()); + } + } + return false; + } +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
