[GitHub] [calcite] kasakrisz commented on a change in pull request #1868: [CALCITE-3867] Support RelDistribution json serialization
kasakrisz commented on a change in pull request #1868: [CALCITE-3867] Support RelDistribution json serialization URL: https://github.com/apache/calcite/pull/1868#discussion_r396998390 ## File path: core/src/main/java/org/apache/calcite/rel/RelDistributions.java ## @@ -80,6 +80,10 @@ public static RelDistribution range(Collection numbers) { return RelDistributionTraitDef.INSTANCE.canonize(trait); } + public static RelDistribution with(RelDistribution.Type type, ImmutableIntList keys) { Review comment: Renamed to `of` 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [calcite] kasakrisz commented on a change in pull request #1868: [CALCITE-3867] Support RelDistribution json serialization
kasakrisz commented on a change in pull request #1868: [CALCITE-3867] Support RelDistribution json serialization URL: https://github.com/apache/calcite/pull/1868#discussion_r396998542 ## File path: core/src/test/java/org/apache/calcite/plan/RelWriterTest.java ## @@ -362,7 +397,7 @@ LogicalTableScan scan = LogicalTableScan.create(cluster, relOptSchema.getTableForMember( - Arrays.asList("hr", "emps")), + asList("hr", "emps")), Review comment: Removed. 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [calcite] kasakrisz commented on a change in pull request #1868: [CALCITE-3867] Support RelDistribution json serialization
kasakrisz commented on a change in pull request #1868: [CALCITE-3867] Support RelDistribution json serialization URL: https://github.com/apache/calcite/pull/1868#discussion_r396997511 ## File path: core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java ## @@ -190,8 +193,35 @@ public RelFieldCollation toFieldCollation(Map map) { return new RelFieldCollation(field, direction, nullDirection); } - public RelDistribution toDistribution(Object o) { -return RelDistributions.ANY; // TODO: + public RelDistribution toDistribution(Map map) { +final RelDistribution.Type type = Review comment: In Apache Hive there is a command `EXPLAIN FORMATTED `: it prints out the json representation of the plan generated by Calcite. I am working on an implementation of enabling Calcite planner in Hive when queries has `SORT BY` clause. `SORT BY` is translated to `SortExchange` which has `RelDistribution` and the command I mentioned above failed with serialization exception. This change is part of a bigger one: https://issues.apache.org/jira/browse/HIVE-22785 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: us...@infra.apache.org With regards, Apache Git Services