[enhancement](Nereids) format some code in functional deps (#27797)
This commit is contained in:
@ -49,6 +49,7 @@ import org.apache.doris.nereids.util.JoinUtils;
|
||||
import org.apache.doris.nereids.util.PlanUtils;
|
||||
import org.apache.doris.qe.ConnectContext;
|
||||
|
||||
import cfjd.com.google.common.collect.ImmutableList;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
@ -380,8 +381,8 @@ public class PlanReceiver implements AbstractReceiver {
|
||||
if (!outputSet.equals(new HashSet<>(projects))) {
|
||||
LogicalProperties projectProperties = new LogicalProperties(
|
||||
() -> projects.stream()
|
||||
.map(p -> p.toSlot())
|
||||
.collect(Collectors.toList()), () -> FunctionalDependencies.EMPTY_FUNC_DEPS);
|
||||
.map(NamedExpression::toSlot)
|
||||
.collect(ImmutableList.toImmutableList()), () -> FunctionalDependencies.EMPTY_FUNC_DEPS);
|
||||
allChild = allChild.stream()
|
||||
.map(c -> new PhysicalProject<>(projects, projectProperties, c))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@ -32,6 +32,7 @@ import java.util.stream.Collectors;
|
||||
* 2. uniform slotL it means the column that has ndv = 1, can be null
|
||||
*/
|
||||
public class FunctionalDependencies {
|
||||
|
||||
public static final FunctionalDependencies EMPTY_FUNC_DEPS
|
||||
= new FunctionalDependencies(new NestedSet().toImmutable(), new NestedSet().toImmutable());
|
||||
private final NestedSet uniqueSet;
|
||||
@ -81,8 +82,7 @@ public class FunctionalDependencies {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "uniform:" + uniformSet
|
||||
+ "\t unique:" + uniqueSet;
|
||||
return String.format("FuncDeps[uniform:%s, unique:%s]", uniformSet, uniqueSet);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -125,8 +125,9 @@ public abstract class LogicalCatalogRelation extends LogicalRelation implements
|
||||
if (table instanceof OlapTable && ((OlapTable) table).getKeysType().isAggregationFamily()) {
|
||||
ImmutableSet<Slot> slotSet = computeOutput().stream()
|
||||
.filter(SlotReference.class::isInstance)
|
||||
.filter(s -> ((SlotReference) s).getColumn().isPresent()
|
||||
&& ((SlotReference) s).getColumn().get().isKey())
|
||||
.map(SlotReference.class::cast)
|
||||
.filter(s -> s.getColumn().isPresent()
|
||||
&& s.getColumn().get().isKey())
|
||||
.collect(ImmutableSet.toImmutableSet());
|
||||
fdBuilder.addUniqueSlot(slotSet);
|
||||
}
|
||||
|
||||
@ -47,8 +47,8 @@ import java.util.Optional;
|
||||
/**
|
||||
* Logical Check Policy
|
||||
*/
|
||||
public class LogicalCheckPolicy<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_TYPE> implements
|
||||
PropagateFuncDeps {
|
||||
public class LogicalCheckPolicy<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_TYPE>
|
||||
implements PropagateFuncDeps {
|
||||
|
||||
public LogicalCheckPolicy(CHILD_TYPE child) {
|
||||
super(PlanType.LOGICAL_CHECK_POLICY, child);
|
||||
|
||||
Reference in New Issue
Block a user