You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "darpan-14 (via GitHub)" <gi...@apache.org> on 2026/08/31 19:04:14 UTC
[PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
darpan-14 opened a new pull request, #5235:
URL: https://github.com/apache/calcite/pull/5235
## Jira Link
[CALCITE-7757](https://issues.apache.org/jira/browse/CALCITE-7757)
## Changes Proposed
RelMdFunctionalDependency can currently expose unsound or incorrectly indexed dependencies, allowing AggregateRemoveDuplicateKeysRule to remove grouping keys that are still required.
This change:
- Corrects equality-derived functional dependencies for INNER, LEFT, and RIGHT joins, respecting the null-generating side of outer joins.
- Preserves valid input functional dependencies through outer joins without incorrectly deriving the reverse dependency from the join equality.
- Maps aggregate input group ordinals to aggregate output ordinals before publishing functional-dependency metadata.
- Avoids equality-derived dependencies for FLOAT, REAL, DOUBLE, and INTERVAL types, including nested occurrences.
- Avoids unsafe expression-derived grouping dependencies for those same types.
- Adds a reusable SqlTypeUtil predicate traversal for scalar and nested types.
- Adds regression coverage for each correctness case.
A basic valid duplicate-key removal remains supported:
SELECT t1.col1, t2.col3, COUNT(*)
FROM t1
JOIN t2 ON t1.col1 = t2.col3
GROUP BY t1.col1, t2.col3;
For this inner join, either equivalent equality key may be removed. The new safeguards prevent that reasoning from being applied where null generation, ordinal mapping, or non-reflexive type semantics make it unsound.
## Testing
- ./gradlew :core:test --tests org.apache.calcite.sql.type.SqlTypeUtilTest --tests org.apache.calcite.test.AggregateRemoveDuplicateKeysRuleTest --tests org.apache.calcite.test.RelMetadataTest.testFunctionalDependency*
- ./gradlew :core:checkstyleMain :core:checkstyleTest
- git diff --check upstream/main...HEAD
The focused test run completed 49 tests with 0 failures.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "darpan-14 (via GitHub)" <gi...@apache.org>.
darpan-14 commented on code in PR #5235:
URL: https://github.com/apache/calcite/pull/5235#discussion_r3922187326
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdFunctionalDependency.java:
##########
@@ -428,50 +466,93 @@ private ArrowSet getCalcFD(Calc rel, RelMetadataQuery mq) {
}
/**
- * Shifts column indices in functional dependencies (for right table in Joins).
- *
- * @param fdSet Functional dependency set
- * @param offset Index offset
- * @return Shifted functional dependency set
+ * Adds functional dependencies implied by a join condition.
*/
- private ArrowSet shiftFdSet(ArrowSet fdSet, int offset) {
- ArrowSet.Builder shiftedFdSetBuilder = new ArrowSet.Builder();
- for (Arrow fd : fdSet.getArrows()) {
- ImmutableBitSet shiftedDeterminants = fd.getDeterminants().shift(offset);
- ImmutableBitSet shiftedDependents = fd.getDependents().shift(offset);
- shiftedFdSetBuilder.addArrow(shiftedDeterminants, shiftedDependents);
+ private static void addFDsFromJoinCondition(Join rel, int leftFieldCount,
+ ArrowSet.Builder builder) {
+ final JoinRelType joinType = rel.getJoinType();
+ if (joinType == JoinRelType.INNER) {
+ addBidirectionalFDsFromEqualityCondition(rel.getCondition(), builder);
+ return;
}
- return shiftedFdSetBuilder.build();
+
+ if (joinType == JoinRelType.LEFT || joinType == JoinRelType.RIGHT) {
+ final JoinInfo joinInfo = rel.analyzeCondition();
+ if (!joinInfo.isEqui() || joinInfo.leftKeys.isEmpty()
+ || !fieldsSupportEqualityInference(rel.getLeft(), joinInfo.leftSet())
+ || !fieldsSupportEqualityInference(rel.getRight(), joinInfo.rightSet())) {
+ return;
+ }
+
+ final ImmutableBitSet leftKeys = joinInfo.leftSet();
+ final ImmutableBitSet rightKeys = joinInfo.rightSet().shift(leftFieldCount);
+ if (joinType == JoinRelType.LEFT) {
+ builder.addArrow(leftKeys, rightKeys);
+ } else {
+ builder.addArrow(rightKeys, leftKeys);
+ }
+ return;
+ }
+
+ throw new AssertionError("unsupported join type: " + joinType);
}
/**
- * Extracts functional dependencies from equality and AND conditions.
- * Handles col1 = col2, col1 IS NOT DISTINCT FROM col2, and AND conditions.
+ * Adds bidirectional dependencies for input-reference equalities in a
+ * condition. Callers are responsible for ensuring that every output row
+ * satisfies the condition, as is true for Filters and inner joins.
*/
- private static void addFDsFromEqualityCondition(RexNode condition, ArrowSet.Builder builder) {
- if (!(condition instanceof RexCall)) {
- return;
- }
+ private static void addBidirectionalFDsFromEqualityCondition(
+ RexNode condition, ArrowSet.Builder builder) {
+ for (RexNode conjunct : RelOptUtil.conjunctions(condition)) {
+ if (!(conjunct instanceof RexCall)) {
+ continue;
+ }
- RexCall call = (RexCall) condition;
- if (call.getOperator().getKind() == SqlKind.EQUALS
- || call.getOperator().getKind() == SqlKind.IS_NOT_DISTINCT_FROM) {
+ RexCall call = (RexCall) conjunct;
+ if (call.getOperator().getKind() != SqlKind.EQUALS
+ && call.getOperator().getKind() != SqlKind.IS_NOT_DISTINCT_FROM) {
+ continue;
+ }
List<RexNode> operands = call.getOperands();
if (operands.size() == 2) {
RexNode left = operands.get(0);
RexNode right = operands.get(1);
- if (left instanceof RexInputRef && right instanceof RexInputRef) {
+ if (left instanceof RexInputRef && right instanceof RexInputRef
+ && typeSupportsGroupKeyInference(left.getType())
+ && typeSupportsGroupKeyInference(right.getType())) {
int leftRef = ((RexInputRef) left).getIndex();
int rightRef = ((RexInputRef) right).getIndex();
builder.addBidirectionalArrow(leftRef, rightRef);
}
}
- } else if (call.getOperator().getKind() == SqlKind.AND) {
- for (RexNode operand : call.getOperands()) {
- addFDsFromEqualityCondition(operand, builder);
+ }
+ }
+
+ /**
+ * Returns whether equality on the given fields can safely imply a functional
+ * dependency for grouping purposes.
+ */
+ private static boolean fieldsSupportEqualityInference(RelNode input,
+ ImmutableBitSet fields) {
+ for (int field : fields) {
+ if (!typeSupportsGroupKeyInference(
+ input.getRowType().getFieldList().get(field).getType())) {
+ return false;
}
}
+ return true;
+ }
+
+ /**
+ * Returns whether a type can safely be used to infer that one grouping key
+ * determines another. Approximate numerics and intervals are unsafe,
+ * including when nested in rows, collections, or maps.
+ */
+ private static boolean typeSupportsGroupKeyInference(RelDataType type) {
Review Comment:
They are safe, it was an oversight from my side 😓
I see Calcite normalises intervals under the hood. I will remove this check for intervals.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #5235:
URL: https://github.com/apache/calcite/pull/5235#discussion_r4319318118
##########
core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java:
##########
@@ -405,6 +406,36 @@ public static boolean containsNullable(RelDataType type) {
return false;
}
+ /**
+ * Returns whether a type or any type nested within its fields, collection
+ * component, map key, or map value matches a predicate.
+ */
+ public static boolean containsType(RelDataType type,
Review Comment:
containsMatchingType is a better name
##########
core/src/test/java/org/apache/calcite/test/RelMetadataTest.java:
##########
@@ -709,6 +722,62 @@ final RelMetadataFixture sql(String sql) {
assertThat(mq.determines(relNode, empNo, dname), is(Boolean.FALSE));
}
+ @Test void testFunctionalDependencyOuterJoinEqualityDirection() {
Review Comment:
Missing JavaDoc on test.
##########
core/src/test/java/org/apache/calcite/test/AggregateRemoveDuplicateKeysRuleTest.java:
##########
@@ -72,6 +72,74 @@ private static RelOptFixture sql(String sql) {
.check();
}
+ @Test void testKeepsGroupKeyFromPreservedSideOfLeftJoin() {
+ // The null-generating right key cannot determine the preserved left key:
+ // unmatched rows with different e.deptno values all have d.deptno = NULL.
+ final String sql = "select d.deptno, e.deptno, count(*) as c\n"
+ + "from emp e\n"
+ + "left join dept d on e.deptno = d.deptno\n"
+ + "group by d.deptno, e.deptno";
+
+ sql(sql).withRule(CoreRules.AGGREGATE_REMOVE_DUPLICATE_KEYS)
+ .checkUnchanged();
+ }
+
+ @Test void testKeepsFdFromNullGeneratingInputOfLeftJoin() {
+ // This FD comes from the right input rather than from the join condition.
+ // The right Project has a -> COALESCE(a, 1), but null padding adds a row
+ // with a = NULL and y = NULL alongside the matched a = NULL, y = 1 row.
+ final String sql = "select r.a, r.y, count(*) as c\n"
+ + "from (values (1), (2)) as l(z)\n"
+ + "left join (\n"
+ + " select z, a, coalesce(a, 1) as y\n"
+ + " from (values (1, cast(null as integer))) as v(z, a)\n"
+ + ") as r on l.z = r.z\n"
+ + "group by r.a, r.y";
+
+ sql(sql).withRule(CoreRules.AGGREGATE_REMOVE_DUPLICATE_KEYS)
+ .checkUnchanged();
+ }
+
+ @Test void testMapsFdForNonContiguousAggregateGroupSet() {
+ // AggregateProjectMergeRule changes the input group set to {1, 2, 3},
+ // whose keys occupy output positions {0, 1, 2}. Map the input FD 1 -> 2
Review Comment:
Is this comment valid before or after the fix? If it's before the fix, the comment is already wrong.
##########
core/src/test/java/org/apache/calcite/test/RelMetadataTest.java:
##########
@@ -374,6 +375,18 @@ final RelMetadataFixture sql(String sql) {
assertThat(mq.determines(relNode, sumSal, count), is(Boolean.FALSE));
}
+ @Test void testFunctionalDependencyRollupAggregate() {
Review Comment:
Is this a test case for this issue? Then it needs JavaDoc with a specific format. There are lots of examples to follow.
##########
core/src/test/java/org/apache/calcite/test/AggregateRemoveDuplicateKeysRuleTest.java:
##########
@@ -72,6 +72,74 @@ private static RelOptFixture sql(String sql) {
.check();
}
+ @Test void testKeepsGroupKeyFromPreservedSideOfLeftJoin() {
+ // The null-generating right key cannot determine the preserved left key:
+ // unmatched rows with different e.deptno values all have d.deptno = NULL.
+ final String sql = "select d.deptno, e.deptno, count(*) as c\n"
+ + "from emp e\n"
+ + "left join dept d on e.deptno = d.deptno\n"
+ + "group by d.deptno, e.deptno";
+
+ sql(sql).withRule(CoreRules.AGGREGATE_REMOVE_DUPLICATE_KEYS)
+ .checkUnchanged();
+ }
+
+ @Test void testKeepsFdFromNullGeneratingInputOfLeftJoin() {
+ // This FD comes from the right input rather than from the join condition.
Review Comment:
Which FD? Maybe you can explain what FDs are inferred.
##########
core/src/test/java/org/apache/calcite/test/AggregateRemoveDuplicateKeysRuleTest.java:
##########
@@ -72,6 +72,74 @@ private static RelOptFixture sql(String sql) {
.check();
}
+ @Test void testKeepsGroupKeyFromPreservedSideOfLeftJoin() {
+ // The null-generating right key cannot determine the preserved left key:
Review Comment:
For a reader it's not obvious at all how this test relates to this comment.
You need longer explanations on these tests.
##########
core/src/test/java/org/apache/calcite/test/AggregateRemoveDuplicateKeysRuleTest.java:
##########
@@ -72,6 +72,74 @@ private static RelOptFixture sql(String sql) {
.check();
}
+ @Test void testKeepsGroupKeyFromPreservedSideOfLeftJoin() {
Review Comment:
no JavaDoc on tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "darpan-14 (via GitHub)" <gi...@apache.org>.
darpan-14 commented on PR #5235:
URL: https://github.com/apache/calcite/pull/5235#issuecomment-5771596540
Updated all Javadocs raised in review. The helper methods now document their general behavior, parameters, return value where applicable, where inferred dependencies are recorded, and the relational-output requirement for equality-derived dependencies.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "darpan-14 (via GitHub)" <gi...@apache.org>.
darpan-14 commented on PR #5235:
URL: https://github.com/apache/calcite/pull/5235#issuecomment-6208722028
> When this is ready please re-request a review
I guess this is ready for review again. All comments posted are addressed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "darpan-14 (via GitHub)" <gi...@apache.org>.
darpan-14 commented on PR #5235:
URL: https://github.com/apache/calcite/pull/5235#issuecomment-5489909016
CI is happy now. 😄
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #5235:
URL: https://github.com/apache/calcite/pull/5235#discussion_r3916685285
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdFunctionalDependency.java:
##########
@@ -428,50 +466,93 @@ private ArrowSet getCalcFD(Calc rel, RelMetadataQuery mq) {
}
/**
- * Shifts column indices in functional dependencies (for right table in Joins).
- *
- * @param fdSet Functional dependency set
- * @param offset Index offset
- * @return Shifted functional dependency set
+ * Adds functional dependencies implied by a join condition.
*/
- private ArrowSet shiftFdSet(ArrowSet fdSet, int offset) {
- ArrowSet.Builder shiftedFdSetBuilder = new ArrowSet.Builder();
- for (Arrow fd : fdSet.getArrows()) {
- ImmutableBitSet shiftedDeterminants = fd.getDeterminants().shift(offset);
- ImmutableBitSet shiftedDependents = fd.getDependents().shift(offset);
- shiftedFdSetBuilder.addArrow(shiftedDeterminants, shiftedDependents);
+ private static void addFDsFromJoinCondition(Join rel, int leftFieldCount,
+ ArrowSet.Builder builder) {
+ final JoinRelType joinType = rel.getJoinType();
+ if (joinType == JoinRelType.INNER) {
+ addBidirectionalFDsFromEqualityCondition(rel.getCondition(), builder);
+ return;
}
- return shiftedFdSetBuilder.build();
+
+ if (joinType == JoinRelType.LEFT || joinType == JoinRelType.RIGHT) {
+ final JoinInfo joinInfo = rel.analyzeCondition();
+ if (!joinInfo.isEqui() || joinInfo.leftKeys.isEmpty()
+ || !fieldsSupportEqualityInference(rel.getLeft(), joinInfo.leftSet())
+ || !fieldsSupportEqualityInference(rel.getRight(), joinInfo.rightSet())) {
+ return;
+ }
+
+ final ImmutableBitSet leftKeys = joinInfo.leftSet();
+ final ImmutableBitSet rightKeys = joinInfo.rightSet().shift(leftFieldCount);
+ if (joinType == JoinRelType.LEFT) {
+ builder.addArrow(leftKeys, rightKeys);
+ } else {
+ builder.addArrow(rightKeys, leftKeys);
+ }
+ return;
+ }
+
+ throw new AssertionError("unsupported join type: " + joinType);
}
/**
- * Extracts functional dependencies from equality and AND conditions.
- * Handles col1 = col2, col1 IS NOT DISTINCT FROM col2, and AND conditions.
+ * Adds bidirectional dependencies for input-reference equalities in a
+ * condition. Callers are responsible for ensuring that every output row
+ * satisfies the condition, as is true for Filters and inner joins.
*/
- private static void addFDsFromEqualityCondition(RexNode condition, ArrowSet.Builder builder) {
- if (!(condition instanceof RexCall)) {
- return;
- }
+ private static void addBidirectionalFDsFromEqualityCondition(
+ RexNode condition, ArrowSet.Builder builder) {
+ for (RexNode conjunct : RelOptUtil.conjunctions(condition)) {
+ if (!(conjunct instanceof RexCall)) {
+ continue;
+ }
- RexCall call = (RexCall) condition;
- if (call.getOperator().getKind() == SqlKind.EQUALS
- || call.getOperator().getKind() == SqlKind.IS_NOT_DISTINCT_FROM) {
+ RexCall call = (RexCall) conjunct;
+ if (call.getOperator().getKind() != SqlKind.EQUALS
+ && call.getOperator().getKind() != SqlKind.IS_NOT_DISTINCT_FROM) {
+ continue;
+ }
List<RexNode> operands = call.getOperands();
if (operands.size() == 2) {
RexNode left = operands.get(0);
RexNode right = operands.get(1);
- if (left instanceof RexInputRef && right instanceof RexInputRef) {
+ if (left instanceof RexInputRef && right instanceof RexInputRef
+ && typeSupportsGroupKeyInference(left.getType())
+ && typeSupportsGroupKeyInference(right.getType())) {
int leftRef = ((RexInputRef) left).getIndex();
int rightRef = ((RexInputRef) right).getIndex();
builder.addBidirectionalArrow(leftRef, rightRef);
}
}
- } else if (call.getOperator().getKind() == SqlKind.AND) {
- for (RexNode operand : call.getOperands()) {
- addFDsFromEqualityCondition(operand, builder);
+ }
+ }
+
+ /**
+ * Returns whether equality on the given fields can safely imply a functional
+ * dependency for grouping purposes.
+ */
+ private static boolean fieldsSupportEqualityInference(RelNode input,
+ ImmutableBitSet fields) {
+ for (int field : fields) {
+ if (!typeSupportsGroupKeyInference(
+ input.getRowType().getFieldList().get(field).getType())) {
+ return false;
}
}
+ return true;
+ }
+
+ /**
+ * Returns whether a type can safely be used to infer that one grouping key
+ * determines another. Approximate numerics and intervals are unsafe,
+ * including when nested in rows, collections, or maps.
+ */
+ private static boolean typeSupportsGroupKeyInference(RelDataType type) {
Review Comment:
why are intervals unsafe?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #5235:
URL: https://github.com/apache/calcite/pull/5235#discussion_r4000379017
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdFunctionalDependency.java:
##########
@@ -419,6 +422,41 @@ private ArrowSet getJoinFD(Join rel, RelMetadataQuery mq) {
}
}
+ /**
+ * Copies input dependencies into a join, optionally filtering dependencies
Review Comment:
I don't understand this javadoc. Can you please say what each parameter is and what the function actually computes? There's no "join" to be seen of here.
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdFunctionalDependency.java:
##########
@@ -428,50 +466,93 @@ private ArrowSet getCalcFD(Calc rel, RelMetadataQuery mq) {
}
/**
- * Shifts column indices in functional dependencies (for right table in Joins).
- *
- * @param fdSet Functional dependency set
- * @param offset Index offset
- * @return Shifted functional dependency set
+ * Adds functional dependencies implied by a join condition.
Review Comment:
where does it add the dependencies?
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdFunctionalDependency.java:
##########
@@ -419,6 +422,41 @@ private ArrowSet getJoinFD(Join rel, RelMetadataQuery mq) {
}
}
+ /**
+ * Copies input dependencies into a join, optionally filtering dependencies
+ * that can be invalidated when the input is null-generated.
+ */
+ private static void addJoinInputFDs(ArrowSet inputFdSet, RelNode input,
+ int offset, boolean nullGenerated, ArrowSet.Builder fdBuilder) {
+ for (Arrow inputFd : inputFdSet.getArrows()) {
+ if (nullGenerated && !hasNonNullableDeterminant(inputFd, input)) {
+ continue;
+ }
+ fdBuilder.addArrow(inputFd.getDeterminants().shift(offset),
+ inputFd.getDependents().shift(offset));
+ }
+ }
+
+ /**
+ * Returns whether a dependency's determinant contains a non-nullable input
+ * field. Such a determinant cannot collide with the all-NULL determinant of
Review Comment:
why does this comment mention a LEFT JOIN? There is no left join here. Please make the comment describe this function does.
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdFunctionalDependency.java:
##########
@@ -428,50 +466,93 @@ private ArrowSet getCalcFD(Calc rel, RelMetadataQuery mq) {
}
/**
- * Shifts column indices in functional dependencies (for right table in Joins).
- *
- * @param fdSet Functional dependency set
- * @param offset Index offset
- * @return Shifted functional dependency set
+ * Adds functional dependencies implied by a join condition.
*/
- private ArrowSet shiftFdSet(ArrowSet fdSet, int offset) {
- ArrowSet.Builder shiftedFdSetBuilder = new ArrowSet.Builder();
- for (Arrow fd : fdSet.getArrows()) {
- ImmutableBitSet shiftedDeterminants = fd.getDeterminants().shift(offset);
- ImmutableBitSet shiftedDependents = fd.getDependents().shift(offset);
- shiftedFdSetBuilder.addArrow(shiftedDeterminants, shiftedDependents);
+ private static void addFDsFromJoinCondition(Join rel, int leftFieldCount,
+ ArrowSet.Builder builder) {
+ final JoinRelType joinType = rel.getJoinType();
+ if (joinType == JoinRelType.INNER) {
+ addBidirectionalFDsFromEqualityCondition(rel.getCondition(), builder);
+ return;
}
- return shiftedFdSetBuilder.build();
+
+ if (joinType == JoinRelType.LEFT || joinType == JoinRelType.RIGHT) {
+ final JoinInfo joinInfo = rel.analyzeCondition();
+ if (!joinInfo.isEqui() || joinInfo.leftKeys.isEmpty()
+ || !fieldsSupportEqualityInference(rel.getLeft(), joinInfo.leftSet())
+ || !fieldsSupportEqualityInference(rel.getRight(), joinInfo.rightSet())) {
+ return;
+ }
+
+ final ImmutableBitSet leftKeys = joinInfo.leftSet();
+ final ImmutableBitSet rightKeys = joinInfo.rightSet().shift(leftFieldCount);
+ if (joinType == JoinRelType.LEFT) {
+ builder.addArrow(leftKeys, rightKeys);
+ } else {
+ builder.addArrow(rightKeys, leftKeys);
+ }
+ return;
+ }
+
+ throw new AssertionError("unsupported join type: " + joinType);
}
/**
- * Extracts functional dependencies from equality and AND conditions.
- * Handles col1 = col2, col1 IS NOT DISTINCT FROM col2, and AND conditions.
+ * Adds bidirectional dependencies for input-reference equalities in a
+ * condition. Callers are responsible for ensuring that every output row
Review Comment:
every output row of what?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "darpan-14 (via GitHub)" <gi...@apache.org>.
darpan-14 commented on code in PR #5235:
URL: https://github.com/apache/calcite/pull/5235#discussion_r4291191117
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdFunctionalDependency.java:
##########
@@ -373,7 +373,7 @@ private ArrowSet getAggregateFD(Aggregate rel, RelMetadataQuery mq) {
if (!groupSet.isEmpty() && !rel.getAggCallList().isEmpty()) {
ImmutableBitSet aggCols =
ImmutableBitSet.range(rel.getGroupCount(), rel.getRowType().getFieldCount());
- fdBuilder.addArrow(groupSet, aggCols);
+ fdBuilder.addArrow(ImmutableBitSet.range(rel.getGroupCount()), aggCols);
Review Comment:
included isSimple check as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "darpan-e6 (via GitHub)" <gi...@apache.org>.
darpan-e6 commented on code in PR #5235:
URL: https://github.com/apache/calcite/pull/5235#discussion_r3922130293
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdFunctionalDependency.java:
##########
@@ -428,50 +466,93 @@ private ArrowSet getCalcFD(Calc rel, RelMetadataQuery mq) {
}
/**
- * Shifts column indices in functional dependencies (for right table in Joins).
- *
- * @param fdSet Functional dependency set
- * @param offset Index offset
- * @return Shifted functional dependency set
+ * Adds functional dependencies implied by a join condition.
*/
- private ArrowSet shiftFdSet(ArrowSet fdSet, int offset) {
- ArrowSet.Builder shiftedFdSetBuilder = new ArrowSet.Builder();
- for (Arrow fd : fdSet.getArrows()) {
- ImmutableBitSet shiftedDeterminants = fd.getDeterminants().shift(offset);
- ImmutableBitSet shiftedDependents = fd.getDependents().shift(offset);
- shiftedFdSetBuilder.addArrow(shiftedDeterminants, shiftedDependents);
+ private static void addFDsFromJoinCondition(Join rel, int leftFieldCount,
+ ArrowSet.Builder builder) {
+ final JoinRelType joinType = rel.getJoinType();
+ if (joinType == JoinRelType.INNER) {
+ addBidirectionalFDsFromEqualityCondition(rel.getCondition(), builder);
+ return;
}
- return shiftedFdSetBuilder.build();
+
+ if (joinType == JoinRelType.LEFT || joinType == JoinRelType.RIGHT) {
+ final JoinInfo joinInfo = rel.analyzeCondition();
+ if (!joinInfo.isEqui() || joinInfo.leftKeys.isEmpty()
+ || !fieldsSupportEqualityInference(rel.getLeft(), joinInfo.leftSet())
+ || !fieldsSupportEqualityInference(rel.getRight(), joinInfo.rightSet())) {
+ return;
+ }
+
+ final ImmutableBitSet leftKeys = joinInfo.leftSet();
+ final ImmutableBitSet rightKeys = joinInfo.rightSet().shift(leftFieldCount);
+ if (joinType == JoinRelType.LEFT) {
+ builder.addArrow(leftKeys, rightKeys);
+ } else {
+ builder.addArrow(rightKeys, leftKeys);
+ }
+ return;
+ }
+
+ throw new AssertionError("unsupported join type: " + joinType);
}
/**
- * Extracts functional dependencies from equality and AND conditions.
- * Handles col1 = col2, col1 IS NOT DISTINCT FROM col2, and AND conditions.
+ * Adds bidirectional dependencies for input-reference equalities in a
+ * condition. Callers are responsible for ensuring that every output row
+ * satisfies the condition, as is true for Filters and inner joins.
*/
- private static void addFDsFromEqualityCondition(RexNode condition, ArrowSet.Builder builder) {
- if (!(condition instanceof RexCall)) {
- return;
- }
+ private static void addBidirectionalFDsFromEqualityCondition(
+ RexNode condition, ArrowSet.Builder builder) {
+ for (RexNode conjunct : RelOptUtil.conjunctions(condition)) {
+ if (!(conjunct instanceof RexCall)) {
+ continue;
+ }
- RexCall call = (RexCall) condition;
- if (call.getOperator().getKind() == SqlKind.EQUALS
- || call.getOperator().getKind() == SqlKind.IS_NOT_DISTINCT_FROM) {
+ RexCall call = (RexCall) conjunct;
+ if (call.getOperator().getKind() != SqlKind.EQUALS
+ && call.getOperator().getKind() != SqlKind.IS_NOT_DISTINCT_FROM) {
+ continue;
+ }
List<RexNode> operands = call.getOperands();
if (operands.size() == 2) {
RexNode left = operands.get(0);
RexNode right = operands.get(1);
- if (left instanceof RexInputRef && right instanceof RexInputRef) {
+ if (left instanceof RexInputRef && right instanceof RexInputRef
+ && typeSupportsGroupKeyInference(left.getType())
+ && typeSupportsGroupKeyInference(right.getType())) {
int leftRef = ((RexInputRef) left).getIndex();
int rightRef = ((RexInputRef) right).getIndex();
builder.addBidirectionalArrow(leftRef, rightRef);
}
}
- } else if (call.getOperator().getKind() == SqlKind.AND) {
- for (RexNode operand : call.getOperands()) {
- addFDsFromEqualityCondition(operand, builder);
+ }
+ }
+
+ /**
+ * Returns whether equality on the given fields can safely imply a functional
+ * dependency for grouping purposes.
+ */
+ private static boolean fieldsSupportEqualityInference(RelNode input,
+ ImmutableBitSet fields) {
+ for (int field : fields) {
+ if (!typeSupportsGroupKeyInference(
+ input.getRowType().getFieldList().get(field).getType())) {
+ return false;
}
}
+ return true;
+ }
+
+ /**
+ * Returns whether a type can safely be used to infer that one grouping key
+ * determines another. Approximate numerics and intervals are unsafe,
+ * including when nested in rows, collections, or maps.
+ */
+ private static boolean typeSupportsGroupKeyInference(RelDataType type) {
Review Comment:
They are safe, it was an oversight from my side 😓
I see Calcite normalises intervals under the hood. I will remove this check for intervals.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #5235:
URL: https://github.com/apache/calcite/pull/5235#issuecomment-5484872270
CI doesn't like your changes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5235:
URL: https://github.com/apache/calcite/pull/5235#issuecomment-5953636263
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5235) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5235&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [90.7% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5235&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5235&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5235)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "darpan-e6 (via GitHub)" <gi...@apache.org>.
darpan-e6 commented on PR #5235:
URL: https://github.com/apache/calcite/pull/5235#issuecomment-6409125331
Addressed all test related comments. I tested new QuidemTest results on Postgres 18.6. If you want me to verify on any other db engines, please let me know, I can do that as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "darpan-e6 (via GitHub)" <gi...@apache.org>.
darpan-e6 commented on code in PR #5235:
URL: https://github.com/apache/calcite/pull/5235#discussion_r3922130293
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdFunctionalDependency.java:
##########
@@ -428,50 +466,93 @@ private ArrowSet getCalcFD(Calc rel, RelMetadataQuery mq) {
}
/**
- * Shifts column indices in functional dependencies (for right table in Joins).
- *
- * @param fdSet Functional dependency set
- * @param offset Index offset
- * @return Shifted functional dependency set
+ * Adds functional dependencies implied by a join condition.
*/
- private ArrowSet shiftFdSet(ArrowSet fdSet, int offset) {
- ArrowSet.Builder shiftedFdSetBuilder = new ArrowSet.Builder();
- for (Arrow fd : fdSet.getArrows()) {
- ImmutableBitSet shiftedDeterminants = fd.getDeterminants().shift(offset);
- ImmutableBitSet shiftedDependents = fd.getDependents().shift(offset);
- shiftedFdSetBuilder.addArrow(shiftedDeterminants, shiftedDependents);
+ private static void addFDsFromJoinCondition(Join rel, int leftFieldCount,
+ ArrowSet.Builder builder) {
+ final JoinRelType joinType = rel.getJoinType();
+ if (joinType == JoinRelType.INNER) {
+ addBidirectionalFDsFromEqualityCondition(rel.getCondition(), builder);
+ return;
}
- return shiftedFdSetBuilder.build();
+
+ if (joinType == JoinRelType.LEFT || joinType == JoinRelType.RIGHT) {
+ final JoinInfo joinInfo = rel.analyzeCondition();
+ if (!joinInfo.isEqui() || joinInfo.leftKeys.isEmpty()
+ || !fieldsSupportEqualityInference(rel.getLeft(), joinInfo.leftSet())
+ || !fieldsSupportEqualityInference(rel.getRight(), joinInfo.rightSet())) {
+ return;
+ }
+
+ final ImmutableBitSet leftKeys = joinInfo.leftSet();
+ final ImmutableBitSet rightKeys = joinInfo.rightSet().shift(leftFieldCount);
+ if (joinType == JoinRelType.LEFT) {
+ builder.addArrow(leftKeys, rightKeys);
+ } else {
+ builder.addArrow(rightKeys, leftKeys);
+ }
+ return;
+ }
+
+ throw new AssertionError("unsupported join type: " + joinType);
}
/**
- * Extracts functional dependencies from equality and AND conditions.
- * Handles col1 = col2, col1 IS NOT DISTINCT FROM col2, and AND conditions.
+ * Adds bidirectional dependencies for input-reference equalities in a
+ * condition. Callers are responsible for ensuring that every output row
+ * satisfies the condition, as is true for Filters and inner joins.
*/
- private static void addFDsFromEqualityCondition(RexNode condition, ArrowSet.Builder builder) {
- if (!(condition instanceof RexCall)) {
- return;
- }
+ private static void addBidirectionalFDsFromEqualityCondition(
+ RexNode condition, ArrowSet.Builder builder) {
+ for (RexNode conjunct : RelOptUtil.conjunctions(condition)) {
+ if (!(conjunct instanceof RexCall)) {
+ continue;
+ }
- RexCall call = (RexCall) condition;
- if (call.getOperator().getKind() == SqlKind.EQUALS
- || call.getOperator().getKind() == SqlKind.IS_NOT_DISTINCT_FROM) {
+ RexCall call = (RexCall) conjunct;
+ if (call.getOperator().getKind() != SqlKind.EQUALS
+ && call.getOperator().getKind() != SqlKind.IS_NOT_DISTINCT_FROM) {
+ continue;
+ }
List<RexNode> operands = call.getOperands();
if (operands.size() == 2) {
RexNode left = operands.get(0);
RexNode right = operands.get(1);
- if (left instanceof RexInputRef && right instanceof RexInputRef) {
+ if (left instanceof RexInputRef && right instanceof RexInputRef
+ && typeSupportsGroupKeyInference(left.getType())
+ && typeSupportsGroupKeyInference(right.getType())) {
int leftRef = ((RexInputRef) left).getIndex();
int rightRef = ((RexInputRef) right).getIndex();
builder.addBidirectionalArrow(leftRef, rightRef);
}
}
- } else if (call.getOperator().getKind() == SqlKind.AND) {
- for (RexNode operand : call.getOperands()) {
- addFDsFromEqualityCondition(operand, builder);
+ }
+ }
+
+ /**
+ * Returns whether equality on the given fields can safely imply a functional
+ * dependency for grouping purposes.
+ */
+ private static boolean fieldsSupportEqualityInference(RelNode input,
+ ImmutableBitSet fields) {
+ for (int field : fields) {
+ if (!typeSupportsGroupKeyInference(
+ input.getRowType().getFieldList().get(field).getType())) {
+ return false;
}
}
+ return true;
+ }
+
+ /**
+ * Returns whether a type can safely be used to infer that one grouping key
+ * determines another. Approximate numerics and intervals are unsafe,
+ * including when nested in rows, collections, or maps.
+ */
+ private static boolean typeSupportsGroupKeyInference(RelDataType type) {
Review Comment:
They are safe, it was an oversight from my side 😓
I see Calcite normalises intervals under the hood. I will remove this check for intervals.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #5235:
URL: https://github.com/apache/calcite/pull/5235#discussion_r4125784582
##########
core/src/test/java/org/apache/calcite/test/AggregateRemoveDuplicateKeysRuleTest.java:
##########
@@ -72,6 +72,77 @@ private static RelOptFixture sql(String sql) {
.check();
}
+ @Test void testKeepsGroupKeyFromPreservedSideOfLeftJoin() {
+ // The null-generating right key cannot determine the preserved left key:
+ // unmatched rows with different e.deptno values all have d.deptno = NULL.
+ final String sql = "select d.deptno, e.deptno, count(*) as c\n"
+ + "from emp e\n"
+ + "left join dept d on e.deptno = d.deptno\n"
+ + "group by d.deptno, e.deptno";
+
+ sql(sql).withRule(CoreRules.AGGREGATE_REMOVE_DUPLICATE_KEYS)
+ .checkUnchanged();
+ }
+
+ @Test void testKeepsFdFromNullGeneratingInputOfLeftJoin() {
+ // This FD comes from the right input rather than from the join condition.
+ // The right Project has a -> COALESCE(a, 1), but null padding adds a row
+ // with a = NULL and y = NULL alongside the matched a = NULL, y = 1 row.
+ final String sql = "select r.a, r.y, count(*) as c\n"
+ + "from (values (1), (2)) as l(z)\n"
+ + "left join (\n"
+ + " select z, a, coalesce(a, 1) as y\n"
+ + " from (values (1, cast(null as integer))) as v(z, a)\n"
+ + ") as r on l.z = r.z\n"
+ + "group by r.a, r.y";
+
+ sql(sql).withRule(CoreRules.AGGREGATE_REMOVE_DUPLICATE_KEYS)
+ .checkUnchanged();
+ }
+
+ @Test void testMapsFdForNonContiguousAggregateGroupSet() {
+ // AggregateProjectMergeRule changes the input group set to {1, 2, 3},
+ // whose keys occupy output positions {0, 1, 2}. Map the input FD 1 -> 2
+ // to output FD 0 -> 1, so the rule removes b rather than c.
+ final String sql = "select a, b, c, count(*) as n\n"
+ + "from (values (0, 1, 1, 10), (0, 1, 1, 20))\n"
+ + " as t(z, a, b, c)\n"
+ + "where a = b\n"
+ + "group by a, b, c";
+
+ sql(sql).withPreRule(CoreRules.AGGREGATE_PROJECT_MERGE)
+ .withRule(CoreRules.AGGREGATE_REMOVE_DUPLICATE_KEYS)
+ .check();
+ }
+
+ @Test void testKeepsDoubleGroupKeyInferredFromEquality() {
+ // SQL equality considers 0.0 and -0.0 equal, but Enumerable grouping
+ // distinguishes their Double keys. Therefore x = y does not prove that
+ // x determines y for the purpose of removing y from the GROUP BY.
+ final String sql = "select x, y, count(*) as c\n"
+ + "from (values\n"
+ + " (cast(0 as double), cast(0 as double)),\n"
+ + " (cast(0 as double), -cast(0 as double))) as t(x, y)\n"
+ + "where x = y\n"
+ + "group by x, y";
+
+ sql(sql).withRule(CoreRules.AGGREGATE_REMOVE_DUPLICATE_KEYS)
+ .checkUnchanged();
+ }
+
+ @Test void testKeepsDerivedGroupKeyForNestedDouble() {
+ // Determinism alone is insufficient for approximate values, including
+ // nested occurrences. Keep the derived key unless grouping equality is
+ // known to be congruent with the expression for ARRAY<DOUBLE>.
Review Comment:
I cannot read this comment. What is "congruent with the expression"?
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdFunctionalDependency.java:
##########
@@ -373,7 +373,7 @@ private ArrowSet getAggregateFD(Aggregate rel, RelMetadataQuery mq) {
if (!groupSet.isEmpty() && !rel.getAggCallList().isEmpty()) {
ImmutableBitSet aggCols =
ImmutableBitSet.range(rel.getGroupCount(), rel.getRowType().getFieldCount());
- fdBuilder.addArrow(groupSet, aggCols);
+ fdBuilder.addArrow(ImmutableBitSet.range(rel.getGroupCount()), aggCols);
Review Comment:
I think you also need to add to line 373 above a check `Aggregate.isSimple(rel)`
Some aggregates like ROLLUP are not simple; maybe you can add a suitable test case:
`select a, count(*) c from t group by rollup(a)`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #5235:
URL: https://github.com/apache/calcite/pull/5235#issuecomment-5937386650
When this is ready please re-request a review
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5235:
URL: https://github.com/apache/calcite/pull/5235#issuecomment-5492165813
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5235) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5235&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [90.4% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5235&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5235&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5235)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "darpan-e6 (via GitHub)" <gi...@apache.org>.
darpan-e6 commented on PR #5235:
URL: https://github.com/apache/calcite/pull/5235#issuecomment-5489838860
CI is happy now. 😄
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5235:
URL: https://github.com/apache/calcite/pull/5235#issuecomment-5584485224
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5235) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5235&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [90.7% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5235&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5235&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5235)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7757] RelMdFunctionalDependency can infer unsound dependencies and cause incorrect query results [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5235:
URL: https://github.com/apache/calcite/pull/5235#issuecomment-5771781874
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5235) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5235&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [90.8% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5235&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5235&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5235)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org