Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
feiniaofeiafei committed Jan 3, 2025
1 parent e7b6a46 commit 69c3ea6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.doris.nereids.trees.expressions.NamedExpression;
import org.apache.doris.nereids.trees.expressions.Slot;
import org.apache.doris.nereids.trees.expressions.VirtualSlotReference;
import org.apache.doris.nereids.trees.expressions.literal.NullLiteral;
import org.apache.doris.nereids.trees.plans.Plan;
import org.apache.doris.nereids.trees.plans.PlanType;
import org.apache.doris.nereids.trees.plans.algebra.Repeat;
Expand All @@ -35,12 +34,9 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;

/**
* LogicalRepeat.
Expand Down Expand Up @@ -194,19 +190,8 @@ public void computeUnique(DataTrait.Builder builder) {

@Override
public void computeUniform(DataTrait.Builder builder) {
DataTrait dataTrait = child(0).getLogicalProperties().getTrait();
Set<Expression> common = getCommonGroupingSetExpressions();
Map<Slot, Optional<Expression>> slotUniformValue = dataTrait.getSlotUniformValueMap();
Map<Slot, Optional<Expression>> newSlotUniformValue = new HashMap<>();
for (Map.Entry<Slot, Optional<Expression>> entry : slotUniformValue.entrySet()) {
Optional<Expression> value = entry.getValue();
if (!value.isPresent() || value.get() instanceof NullLiteral || common.contains(value.get())) {
newSlotUniformValue.put(entry.getKey(), value);
} else {
newSlotUniformValue.put(entry.getKey(), Optional.empty());
}
}
builder.addUniformSlotValueMap(newSlotUniformValue);
// don't generate uniform slot
// TODO: this need be supported later
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ void testAgg() {
.rewrite()
.getPlan();
System.out.println(plan.getLogicalProperties().getTrait());
Assertions.assertTrue(plan.getLogicalProperties().getTrait().isUniform(plan.getOutput().get(0))
&& !plan.getLogicalProperties().getTrait().isUniformAndNotNull(plan.getOutput().get(0)));
// Assertions.assertTrue(plan.getLogicalProperties().getTrait().isUniform(plan.getOutput().get(0)));
}

@Test
Expand Down

0 comments on commit 69c3ea6

Please sign in to comment.