This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new 719e2b50f2d branch-3.1: [fix](nereids) adjust logical repeat property
derive #44360 (#51965)
719e2b50f2d is described below
commit 719e2b50f2d70a351b42c6b2f87bbe87a3f517c5
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jun 20 13:26:01 2025 +0800
branch-3.1: [fix](nereids) adjust logical repeat property derive #44360
(#51965)
Cherry-picked from #44360
Co-authored-by: feiniaofeiafei <[email protected]>
---
.../properties/ChildOutputPropertyDeriver.java | 24 ++++++++--------------
.../properties/ChildOutputPropertyDeriverTest.java | 23 +++++++++++++++++++++
2 files changed, 32 insertions(+), 15 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildOutputPropertyDeriver.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildOutputPropertyDeriver.java
index 7c78779b8b6..941e07eac61 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildOutputPropertyDeriver.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildOutputPropertyDeriver.java
@@ -71,6 +71,7 @@ import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import java.util.Arrays;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -372,22 +373,15 @@ public class ChildOutputPropertyDeriver extends
PlanVisitor<PhysicalProperties,
);
}
List<ExprId> orderedShuffledColumns =
distributionSpecHash.getOrderedShuffledColumns();
- if (!intersectGroupingKeys.isEmpty() &&
intersectGroupingKeys.size()
- >= Sets.newHashSet(orderedShuffledColumns).size()) {
- boolean hashColumnsChanged = false;
- for (Expression intersectGroupingKey :
intersectGroupingKeys) {
- if (!(intersectGroupingKey instanceof SlotReference)) {
- hashColumnsChanged = true;
- break;
- }
- if (!(orderedShuffledColumns.contains(((SlotReference)
intersectGroupingKey).getExprId()))) {
- hashColumnsChanged = true;
- break;
- }
- }
- if (!hashColumnsChanged) {
- return childrenOutputProperties.get(0);
+ Set<ExprId> intersectGroupingKeysId = new HashSet<>();
+ for (Expression key : intersectGroupingKeys) {
+ if (!(key instanceof SlotReference)) {
+ break;
}
+ intersectGroupingKeysId.add(((SlotReference)
key).getExprId());
+ }
+ if
(intersectGroupingKeysId.containsAll(orderedShuffledColumns)) {
+ return childrenOutputProperties.get(0);
}
}
output =
PhysicalProperties.createAnyFromHash((DistributionSpecHash)
childDistributionSpec);
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/nereids/properties/ChildOutputPropertyDeriverTest.java
b/fe/fe-core/src/test/java/org/apache/doris/nereids/properties/ChildOutputPropertyDeriverTest.java
index a39bc664e1c..8351b9f8c22 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/nereids/properties/ChildOutputPropertyDeriverTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/nereids/properties/ChildOutputPropertyDeriverTest.java
@@ -885,4 +885,27 @@ class ChildOutputPropertyDeriverTest {
PhysicalProperties result = deriver.getOutputProperties(null,
groupExpression);
Assertions.assertEquals(child, result);
}
+
+ @Test
+ void testRepeatReturnChild2() {
+ SlotReference c1 = new SlotReference(
+ new ExprId(1), "c1", TinyIntType.INSTANCE, true,
ImmutableList.of());
+ SlotReference c2 = new SlotReference(
+ new ExprId(2), "c2", TinyIntType.INSTANCE, true,
ImmutableList.of());
+ SlotReference c3 = new SlotReference(
+ new ExprId(3), "c3", TinyIntType.INSTANCE, true,
ImmutableList.of());
+ PhysicalRepeat<GroupPlan> repeat = new PhysicalRepeat<>(
+ ImmutableList.of(ImmutableList.of(c1, c2, c3),
ImmutableList.of(c1, c2), ImmutableList.of(c1, c2)),
+ ImmutableList.of(c1, c2, c3),
+ logicalProperties,
+ groupPlan
+ );
+ GroupExpression groupExpression = new GroupExpression(repeat);
+ new Group(null, groupExpression, null);
+ PhysicalProperties child = PhysicalProperties.createHash(
+ ImmutableList.of(new ExprId(1)),
ShuffleType.EXECUTION_BUCKETED);
+ ChildOutputPropertyDeriver deriver = new
ChildOutputPropertyDeriver(Lists.newArrayList(child));
+ PhysicalProperties result = deriver.getOutputProperties(null,
groupExpression);
+ Assertions.assertEquals(child, result);
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]