zstan commented on a change in pull request #9800:
URL: https://github.com/apache/ignite/pull/9800#discussion_r800456439
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rule/FilterSpoolMergeToSortedIndexSpoolRule.java
##########
@@ -75,13 +83,50 @@ private FilterSpoolMergeToSortedIndexSpoolRule(Config cfg) {
if (F.isEmpty(idxCond.lowerCondition()) &&
F.isEmpty(idxCond.upperCondition()))
return;
- RelCollation collation =
TraitUtils.createCollation(ImmutableList.copyOf(idxCond.keys()));
-
+ RelCollation traitCollation;
+ RelCollation searchCollation;
+
+ if (inCollation == null || inCollation.isDefault()) {
+ // Create collation by index condition.
+ List<RexNode> lowerBound = idxCond.lowerBound();
+ List<RexNode> upperBound = idxCond.upperBound();
+
+ int cardinality = lowerBound != null ? lowerBound.size() :
upperBound.size();
+
+ List<Integer> equalsFields = new ArrayList<>(cardinality);
+ List<Integer> otherFields = new ArrayList<>(cardinality);
+
Review comment:
possibly we need to append smt like :
` if (lowerBound != null && upperBound != null)
assert lowerBound.size() == upperBound.size();`
--
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]