Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed Mar 5, 2024
1 parent 1d9dd9e commit bdb25a2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ public Set<Slot> getCorrelatedSlots() {

/** findSlotIgnoreCase */
public List<Slot> findSlotIgnoreCase(String slotName) {
// Builder<Slot> candidateSlots = ImmutableList.builder();
// for (Slot slot : slots) {
// if (slot.getName().equalsIgnoreCase(slotName)) {
// candidateSlots.add(slot);
// }
// }
// return candidateSlots.build();
return nameToSlot.get().get(slotName.toUpperCase(Locale.ROOT));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.apache.doris.nereids.rules.Rule;
import org.apache.doris.nereids.rules.RuleType;
import org.apache.doris.nereids.rules.expression.ExpressionRewriteContext;
import org.apache.doris.nereids.rules.expression.rules.FunctionBinder;
import org.apache.doris.nereids.trees.expressions.Alias;
import org.apache.doris.nereids.trees.expressions.BoundStar;
import org.apache.doris.nereids.trees.expressions.DefaultValueSlot;
Expand Down Expand Up @@ -105,7 +104,6 @@
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -668,58 +666,6 @@ private Plan bindSortWithoutSetOperation(MatchingContext<LogicalSort<Plan>> ctx)
return new LogicalSort<>(boundOrderKeys.build(), input);
}

private <E extends Expression> List<E> bindSlot(
List<E> exprList, Plan input, CascadesContext cascadesContext) {
List<E> slots = new ArrayList<>(exprList.size());
for (E expr : exprList) {
E result = bindSlot(expr, input, cascadesContext);
slots.add(result);
}
return slots;
}

private <E extends Expression> E bindSlot(E expr, Plan input, CascadesContext cascadesContext) {
return bindSlot(expr, input, cascadesContext, true, true);
}

private <E extends Expression> E bindSlot(E expr, Plan input, CascadesContext cascadesContext,
boolean enableExactMatch) {
return bindSlot(expr, input, cascadesContext, enableExactMatch, true);
}

private <E extends Expression> E bindSlot(E expr, Plan input, CascadesContext cascadesContext,
boolean enableExactMatch, boolean bindSlotInOuterScope) {
return (E) new SlotBinder(toScope(cascadesContext, input.getOutput()), cascadesContext,
enableExactMatch, bindSlotInOuterScope).bind(expr);
}

@SuppressWarnings("unchecked")
private <E extends Expression> E bindSlot(E expr, List<Plan> inputs, CascadesContext cascadesContext,
boolean enableExactMatch) {
return bindSlot(expr, inputs, cascadesContext, enableExactMatch, true);
}

private <E extends Expression> E bindSlot(E expr, List<Plan> inputs, CascadesContext cascadesContext,
boolean enableExactMatch, boolean bindSlotInOuterScope) {
List<Slot> boundedSlots = new ArrayList<>();
for (Plan input : inputs) {
boundedSlots.addAll(input.getOutput());
}
return (E) new SlotBinder(toScope(cascadesContext, boundedSlots), cascadesContext,
enableExactMatch, bindSlotInOuterScope).bind(expr);
}

@SuppressWarnings("unchecked")
private <E extends Expression> E bindSlot(E expr, List<Plan> inputs, CascadesContext cascadesContext) {
return bindSlot(expr, inputs, cascadesContext, true);
}

@SuppressWarnings("unchecked")
private <E extends Expression> E bindFunction(E expr, Plan plan, CascadesContext cascadesContext) {
return (E) FunctionBinder.INSTANCE.rewrite(checkBoundExceptLambda(expr, plan),
new ExpressionRewriteContext(cascadesContext));
}

/**
* For the columns whose output exists in grouping sets, they need to be assigned as nullable.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,49 +615,6 @@ protected List<? extends Expression> bindSlotByThisScope(UnboundSlot unboundSlot

/** bindSlotByScope */
public List<Slot> bindSlotByScope(UnboundSlot unboundSlot, Scope scope) {
// return scope.getSlots().stream().distinct().filter(boundSlot -> {
// if (boundSlot instanceof SlotReference
// && ((SlotReference) boundSlot).hasSubColPath()) {
// // already bounded
// return false;
// }
// List<String> nameParts = unboundSlot.getNameParts();
// int qualifierSize = boundSlot.getQualifier().size();
// int namePartsSize = nameParts.size();
// if (namePartsSize > qualifierSize + 1) {
// return false;
// }
// if (namePartsSize == 1) {
// return nameParts.get(0).equalsIgnoreCase(boundSlot.getName());
// }
// if (namePartsSize == 2) {
// String qualifierTableName = boundSlot.getQualifier().get(qualifierSize - 1);
// return sameTableName(qualifierTableName, nameParts.get(0))
// && boundSlot.getName().equalsIgnoreCase(nameParts.get(1));
// }
// if (nameParts.size() == 3) {
// String qualifierTableName = boundSlot.getQualifier().get(qualifierSize - 1);
// String qualifierDbName = boundSlot.getQualifier().get(qualifierSize - 2);
// return compareDbName(nameParts.get(0), qualifierDbName)
// && sameTableName(qualifierTableName, nameParts.get(1))
// && boundSlot.getName().equalsIgnoreCase(nameParts.get(2));
// }
// // catalog.db.table.column
// if (nameParts.size() == 4) {
// String qualifierTableName = boundSlot.getQualifier().get(qualifierSize - 1);
// String qualifierDbName = boundSlot.getQualifier().get(qualifierSize - 2);
// String qualifierCatalogName = boundSlot.getQualifier().get(qualifierSize - 3);
// return qualifierCatalogName.equalsIgnoreCase(nameParts.get(0))
// && compareDbName(nameParts.get(1), qualifierDbName)
// && sameTableName(qualifierTableName, nameParts.get(2))
// && boundSlot.getName().equalsIgnoreCase(nameParts.get(3));
// }
// //TODO: handle name parts more than three.
// throw new AnalysisException("Not supported name: "
// + StringUtils.join(nameParts, "."));
// })
// .map(s -> s.withName(unboundSlot.getNameParts().get(unboundSlot.getNameParts().size() - 1)))
// .collect(Collectors.toList());
List<String> nameParts = unboundSlot.getNameParts();
int namePartSize = nameParts.size();
switch (namePartSize) {
Expand Down

0 comments on commit bdb25a2

Please sign in to comment.