[RuntimeFilter] (vec) support runtime filter in indeed slot id (#13556)

This commit is contained in:
HappenLee
2022-10-21 21:41:23 +08:00
committed by GitHub
parent c1cce29b20
commit 122f36e5be
3 changed files with 17 additions and 0 deletions

View File

@ -1207,6 +1207,10 @@ public abstract class Expr extends TreeNode<Expr> implements ParseNode, Cloneabl
}
}
public Expr getRealSlotRef() {
return this;
}
public void getTableIdToColumnNames(Map<Long, Set<String>> tableIdToColumnNames) {
Preconditions.checkState(tableIdToColumnNames != null);
for (Expr child : children) {

View File

@ -358,6 +358,18 @@ public class SlotRef extends Expr {
}
}
@Override
public Expr getRealSlotRef() {
Preconditions.checkState(!type.equals(Type.INVALID));
Preconditions.checkState(desc != null);
if (!desc.getSourceExprs().isEmpty()
&& desc.getSourceExprs().get(0) instanceof SlotRef) {
return desc.getSourceExprs().get(0);
} else {
return this;
}
}
@Override
public void getIds(List<TupleId> tupleIds, List<SlotId> slotIds) {
Preconditions.checkState(!type.equals(Type.INVALID));

View File

@ -269,6 +269,7 @@ public final class RuntimeFilter {
return null;
}
targetExpr = targetExpr.getRealSlotRef();
Map<TupleId, List<SlotId>> targetSlots = getTargetSlots(analyzer, targetExpr);
Preconditions.checkNotNull(targetSlots);
if (targetSlots.isEmpty()) {