You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/04/14 13:05:23 UTC
[GitHub] [ignite] gvvinblade opened a new pull request #7673: IGNITE-12864:
Calcite integration. UNION support.
gvvinblade opened a new pull request #7673: IGNITE-12864: Calcite integration. UNION support.
URL: https://github.com/apache/ignite/pull/7673
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [ignite] gvvinblade closed pull request #7673: IGNITE-12864:
Calcite integration. UNION support.
Posted by GitBox <gi...@apache.org>.
gvvinblade closed pull request #7673: IGNITE-12864: Calcite integration. UNION support.
URL: https://github.com/apache/ignite/pull/7673
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [ignite] gvvinblade commented on a change in pull request #7673:
IGNITE-12864: Calcite integration. UNION support.
Posted by GitBox <gi...@apache.org>.
gvvinblade commented on a change in pull request #7673: IGNITE-12864: Calcite integration. UNION support.
URL: https://github.com/apache/ignite/pull/7673#discussion_r409529543
##########
File path: modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/trait/DistributionTrait.java
##########
@@ -139,14 +139,34 @@
/** {@inheritDoc} */
@Override public IgniteDistribution apply(Mappings.TargetMapping mapping) {
- if (keys.isEmpty())
+ if (getType() != HASH_DISTRIBUTED)
return this;
- assert getType() == HASH_DISTRIBUTED;
+ if (mapping.getTargetCount() < keys.size())
+ IgniteDistributions.random();
- ImmutableIntList newKeys = IgniteDistributions.projectDistributionKeys(mapping, keys);
+ int[] map = new int[mapping.getSourceCount()];
+ int[] res = new int[keys.size()];
- return newKeys.isEmpty() ? IgniteDistributions.random() : IgniteDistributions.hash(newKeys, function);
+ for (int i = 0; i < keys.size(); i++)
+ map[keys.getInt(i)] = i + 1;
+
+ for (int i = 0, found = 0; i < mapping.getTargetCount(); i++) {
+ int source = mapping.getSourceOpt(i);
+ int keyPos = map[source] - 1;
+
+ if (keyPos == -1)
+ continue;
+
+ res[keyPos] = i;
+
+ if (++found == keys.size())
+ return IgniteDistributions.hash(ImmutableIntList.of(res), function);
Review comment:
Actually almost the same, but TargetMapping and Mapping are different interfaces
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [ignite] rkondakov commented on a change in pull request #7673:
IGNITE-12864: Calcite integration. UNION support.
Posted by GitBox <gi...@apache.org>.
rkondakov commented on a change in pull request #7673: IGNITE-12864: Calcite integration. UNION support.
URL: https://github.com/apache/ignite/pull/7673#discussion_r409505004
##########
File path: modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/trait/DistributionTrait.java
##########
@@ -139,14 +139,34 @@
/** {@inheritDoc} */
@Override public IgniteDistribution apply(Mappings.TargetMapping mapping) {
- if (keys.isEmpty())
+ if (getType() != HASH_DISTRIBUTED)
return this;
- assert getType() == HASH_DISTRIBUTED;
+ if (mapping.getTargetCount() < keys.size())
+ IgniteDistributions.random();
- ImmutableIntList newKeys = IgniteDistributions.projectDistributionKeys(mapping, keys);
+ int[] map = new int[mapping.getSourceCount()];
+ int[] res = new int[keys.size()];
- return newKeys.isEmpty() ? IgniteDistributions.random() : IgniteDistributions.hash(newKeys, function);
+ for (int i = 0; i < keys.size(); i++)
+ map[keys.getInt(i)] = i + 1;
+
+ for (int i = 0, found = 0; i < mapping.getTargetCount(); i++) {
+ int source = mapping.getSourceOpt(i);
+ int keyPos = map[source] - 1;
+
+ if (keyPos == -1)
+ continue;
+
+ res[keyPos] = i;
+
+ if (++found == keys.size())
+ return IgniteDistributions.hash(ImmutableIntList.of(res), function);
Review comment:
isn't it the same as `Mappings.apply2`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services