[Bug](query) fix meet invalid column when direct scan on mow mv (#37806)

pick from #36483
This commit is contained in:
Pxl
2024-07-15 18:29:30 +08:00
committed by GitHub
parent ce4983eaf2
commit d1fc4e2e60
3 changed files with 72 additions and 7 deletions

View File

@ -18,7 +18,6 @@
package org.apache.doris.nereids.rules.analysis;
import org.apache.doris.catalog.Column;
import org.apache.doris.catalog.KeysType;
import org.apache.doris.catalog.OlapTable;
import org.apache.doris.catalog.Partition;
import org.apache.doris.catalog.TableIf;
@ -202,10 +201,8 @@ public class BindRelation extends OneAnalysisRuleFactory {
throw new AnalysisException("Table " + olapTable.getName()
+ " doesn't have materialized view " + indexName.get());
}
PreAggStatus preAggStatus
= olapTable.getIndexMetaByIndexId(indexId).getKeysType().equals(KeysType.DUP_KEYS)
? PreAggStatus.unset()
: PreAggStatus.off("For direct index scan.");
PreAggStatus preAggStatus = olapTable.isDupKeysOrMergeOnWrite() ? PreAggStatus.unset()
: PreAggStatus.off("For direct index scan on mor/agg.");
scan = new LogicalOlapScan(unboundRelation.getRelationId(),
(OlapTable) table, qualifier, tabletIds,
@ -219,8 +216,7 @@ public class BindRelation extends OneAnalysisRuleFactory {
}
}
if (!Util.showHiddenColumns() && scan.getTable().hasDeleteSign()
&& !ConnectContext.get().getSessionVariable().skipDeleteSign()
&& !scan.isDirectMvScan()) {
&& !ConnectContext.get().getSessionVariable().skipDeleteSign()) {
// table qualifier is catalog.db.table, we make db.table.column
Slot deleteSlot = null;
for (Slot slot : scan.getOutput()) {