Aaaaaaron edited a comment on pull request #2030:
URL: https://github.com/apache/calcite/pull/2030#issuecomment-646487303


   > > The code looks really redundant, cuz RelDistribution#getKeys is 
annotated as nonnull, and must return "List".
   > > Or do I miss something?
   > 
   > It is nonnull, but can it be empty ?
   
   The empty list like this seems more reasonable?
   ```
         "distribution": {
           "type": "HASH_DISTRIBUTED",
           "keys": []
         }
   ```
   
   Now is:
   ```
         "distribution": {
           "type": "HASH_DISTRIBUTED"
         }
   ```
   Seems little weird.
   
   ***
   
   Even if we consider empty, we can use "relDistribution.getKeys()" directly, 
we don't need this:
   ```
         List<Object> keys = new ArrayList<>(relDistribution.getKeys().size()); 
         for (Integer key : relDistribution.getKeys()) {        
           keys.add(toJson(key));       
         }
   ```
   


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


Reply via email to