suibianwanwank commented on code in PR #3976:
URL: https://github.com/apache/calcite/pull/3976#discussion_r1773452097
##########
innodb/src/main/java/org/apache/calcite/adapter/innodb/InnodbFilter.java:
##########
@@ -96,4 +98,9 @@ public static InnodbFilter create(RelOptCluster cluster,
RelTraitSet traitSet,
public RelCollation getImplicitCollation() {
return indexCondition.getImplicitCollation();
}
+
+ @Override public RexNode getCondition() {
Review Comment:
InnodbFIlter's condition contains both indexed and non-indexed conditions,
but only the indexed filter will be executed. This will cause the
FilterReduceExpression to produce incorrect results.
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnUniqueness.java:
##########
@@ -456,51 +456,23 @@ public Boolean areColumnsUnique(Values rel,
RelMetadataQuery mq,
ImmutableBitSet columns, boolean ignoreNulls) {
columns = decorateWithConstantColumnsFromPredicates(columns, rel, mq);
for (RelNode rel2 : rel.getRels()) {
- if (rel2 instanceof Aggregate
Review Comment:
I'm not sure why this restriction was made, but after pullUpPredicate
supported RelSubset, columns would union the constant field, And return false
due to simplyProject. So I remove the restriction here.
##########
geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeSort.java:
##########
@@ -66,7 +66,7 @@ public class GeodeSort extends Sort implements GeodeRel {
@Override public Sort copy(RelTraitSet traitSet, RelNode input,
RelCollation newCollation, RexNode offset, RexNode fetch) {
- return new GeodeSort(getCluster(), traitSet, input, collation, fetch);
Review Comment:
Use the new traitset in the copy of the sort, and the other sort copies as
well.
##########
core/src/test/resources/sql/sub-query.iq:
##########
@@ -922,10 +922,9 @@ EnumerableCalc(expr#0..3=[{inputs}],
expr#4=[null:BOOLEAN], expr#5=[IS NOT NULL(
EnumerableCalc(expr#0..7=[{inputs}], EMPNO=[$t0], SAL=[$t5])
EnumerableTableScan(table=[[scott, EMP]])
EnumerableLimit(fetch=[1])
- EnumerableSort(sort0=[$0], dir0=[DESC])
Review Comment:
The changes to sub-query.iq are due to JoinOnUniqueToSemiJoinRule and
SortRemoveConstantKeysRule taking effect.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]