[ 
https://issues.apache.org/jira/browse/CALCITE-4712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17391776#comment-17391776
 ] 

Julian Hyde commented on CALCITE-4712:
--------------------------------------

Makes sense. A few comments:
* Would this be a class that implements {{interface RelDistribution}}? If so, 
would you use {{RelDistribution.Type.HASH_DISTRIBUTED}} or add a new enum 
constant?
* I'd rename "bucketNum" to "bucketCount" ("num" can sometimes mean "ordinal" 
rather than "cardinality");
* I'd rename "hashFunc" to "hashFunctionName" (no point in abbreviation);
* Consider changing the type of "keys" to "ImmutableList<Integer>" (see [why we 
changed the type of 
AggregateCall.argList|https://github.com/apache/calcite/blob/4bc916619fd286b2c0cc4d5c653c96a68801d74e/core/src/main/java/org/apache/calcite/rel/core/AggregateCall.java#L55]);
* an example of "equivKeys" would be useful;
* if {{nullsColocated}}, would you store (1, null) in the same bucket as (null, 
'a')?

> Add RelHashDistribution
> -----------------------
>
>                 Key: CALCITE-4712
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4712
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Haisheng Yuan
>            Priority: Major
>
> Add RelHashDistribution. The hash distribution should have the following 
> properties:
> {code:java}
> 1. ImmutableIntList keys; // distribution keys
> 2. ImmutableList<ImmutableBitSet> equivKeys; // equivalent keys for each 
> distribution key
> 3. int bucketNum; // number of buckets or shards
> 4. boolean nullsColocated; // are NULLS colocated?
> 5. String hashFunc; // name or identity of hash function
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to