Berkof commented on a change in pull request #498:
URL: https://github.com/apache/ignite-3/pull/498#discussion_r770204198
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rel/IgniteProject.java
##########
@@ -123,7 +125,7 @@ public Project copy(RelTraitSet traitSet, RelNode input,
List<RexNode> projects,
}
if (srcKeys.size() == keys.size()) {
- return Pair.of(nodeTraits, List.of(in.replace(hash(srcKeys,
distribution.function()))));
+ return Pair.of(nodeTraits,
List.of(in.replace(hash(ImmutableIntList.copyOf(srcKeys),
distribution.function()))));
Review comment:
Ok, but we still have a copy here.
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/trait/TraitUtils.java
##########
@@ -575,7 +576,7 @@ private static boolean fillRecursive(RelTraitSet outTraits,
List<List<RelTraitSe
* @param keys The keys to create collation from.
* @return New collation.
*/
- public static RelCollation createCollation(List<Integer> keys) {
+ public static RelCollation createCollation(IntSet keys) {
return RelCollations.of(
keys.stream().map(RelFieldCollation::new).collect(Collectors.toList())
Review comment:
done
##########
File path:
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/BaseAggregateTest.java
##########
@@ -490,12 +491,12 @@ public void sumOnDifferentRowsCount(TestAggregateType
testAgg) {
RootNode<Object[]> root = new RootNode<>(ctx, aggRowType);
root.register(aggChain);
- Set<Integer> grpId = IntStream.range(0,
grps).boxed().collect(Collectors.toSet());
+ IntSet grpId = IntStream.range(0,
grps).boxed().collect(Collectors.toCollection(IntOpenHashSet::new));
Review comment:
Just to use primitive collections everywhere in the codebase.
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/trait/TraitUtils.java
##########
@@ -575,7 +576,7 @@ private static boolean fillRecursive(RelTraitSet outTraits,
List<List<RelTraitSe
* @param keys The keys to create collation from.
* @return New collation.
*/
- public static RelCollation createCollation(List<Integer> keys) {
+ public static RelCollation createCollation(IntSet keys) {
Review comment:
done
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/Commons.java
##########
@@ -598,12 +601,12 @@ public static int nextPowerOf2(int v) {
* @param elems Elems.
* @return The longest possible prefix of {@code seq}.
*/
- public static <T> List<T> maxPrefix(List<T> seq, Collection<T> elems) {
- List<T> res = new ArrayList<>();
+ public static IntList maxPrefix(List<Integer> seq, Collection<Integer>
elems) {
Review comment:
done
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rule/FilterSpoolMergeToSortedIndexSpoolRule.java
##########
@@ -78,7 +77,7 @@ public void onMatch(RelOptRuleCall call) {
return;
}
- RelCollation collation =
TraitUtils.createCollation(List.copyOf(idxCond.keys()));
+ RelCollation collation = TraitUtils.createCollation(idxCond.keys());
Review comment:
Because List.copyOf gives us an immutable collection and
IndexConditions.keys returns unmodifiable IntSet.
--
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]