private Object toJson(RelDistribution relDistribution) {
    final Map<String, Object> map = jsonBuilder.map();
    map.put("type", relDistribution.getType().name());

    if (!relDistribution.getKeys().isEmpty()) {
      List<Object> keys = new ArrayList<>(relDistribution.getKeys().size());
      for (Integer key : relDistribution.getKeys()) {
        keys.add(toJson(key));
      }
      map.put("keys", keys);
    }
    return map;
  }
Hive extension of RelJson.
Implement json serialization of types which are not support by Calcite 1.21.0.
This class can be removed when Calcite is upgraded to 1.23.0
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelJson.java