You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/12/13 06:01:05 UTC

[GitHub] [calcite] yanlin-Lynn commented on a change in pull request #1642: [CALCITE-3583] Support serialized to json and deserialized from json for Exchange relation operator

yanlin-Lynn commented on a change in pull request #1642: [CALCITE-3583] Support serialized to json and deserialized from json for Exchange relation operator
URL: https://github.com/apache/calcite/pull/1642#discussion_r357495982
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/RelDistributions.java
 ##########
 @@ -80,6 +80,15 @@ public static RelDistribution range(Collection<? extends Number> numbers) {
     return RelDistributionTraitDef.INSTANCE.canonize(trait);
   }
 
+  /** Creates a distribution. */
+  public static RelDistribution distribution(
+      RelDistribution.Type type, List<Number> keys) {
+    ImmutableIntList list = ImmutableIntList.copyOf(keys);
+    RelDistributionImpl trait =
+        new RelDistributionImpl(type, list);
+    return RelDistributionTraitDef.INSTANCE.canonize(trait);
+  }
+
 
 Review comment:
   Because `RelDistributionImpl` is private, need this method to create a RelDistributionImpl object from json string.

----------------------------------------------------------------
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