Skip to content

Commit

Permalink
[fix](Nereids) scan should output all invisiable column (#23003) (#23091
Browse files Browse the repository at this point in the history
)
  • Loading branch information
morrySnow authored Aug 17, 2023
1 parent 25a212b commit abb82b0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.apache.doris.catalog.Column;
import org.apache.doris.catalog.OlapTable;
import org.apache.doris.catalog.Table;
import org.apache.doris.common.util.Util;
import org.apache.doris.nereids.memo.GroupExpression;
import org.apache.doris.nereids.properties.LogicalProperties;
import org.apache.doris.nereids.rules.rewrite.mv.AbstractSelectMaterializedIndexRule;
Expand All @@ -33,20 +32,17 @@
import org.apache.doris.nereids.trees.plans.algebra.OlapScan;
import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
import org.apache.doris.nereids.util.Utils;
import org.apache.doris.qe.ConnectContext;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
* Logical OlapScan.
Expand Down Expand Up @@ -290,13 +286,7 @@ public List<Slot> computeOutput() {
if (selectedIndexId != ((OlapTable) table).getBaseIndexId()) {
return getOutputByIndex(selectedIndexId);
}
List<Column> otherColumns = new ArrayList<>();
if (!Util.showHiddenColumns() && getTable().hasDeleteSign()
&& !ConnectContext.get().getSessionVariable()
.skipDeleteSign()) {
otherColumns.add(getTable().getDeleteSignColumn());
}
return Stream.concat(table.getBaseSchema().stream(), otherColumns.stream())
return table.getBaseSchema(true).stream()
.map(col -> {
if (cacheSlotWithSlotName.containsKey(col.getName())) {
return cacheSlotWithSlotName.get(col.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void bindExternalRelation() {
OlapTable externalOlapTable = new OlapTable(1, tableName, externalTableColumns, KeysType.DUP_KEYS,
new PartitionInfo(), new RandomDistributionInfo(10)) {
@Override
public List<Column> getBaseSchema() {
public List<Column> getBaseSchema(boolean full) {
return externalTableColumns;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void testPruneOlapScanTablet(@Mocked OlapTable olapTable,
olapTable.getPartitionIds();
result = ImmutableList.of(1L);

olapTable.getBaseSchema();
olapTable.getBaseSchema(true);
result = columns;

olapTable.getName();
Expand Down

0 comments on commit abb82b0

Please sign in to comment.