public static RelBuilderFactory proto(final Context context) {
    return new RelBuilderFactory() {
      @Override
      public RelBuilder create(RelOptCluster cluster, RelOptSchema schema) {
        Context confContext = Contexts.of(Config.DEFAULT.withPruneInputOfAggregate(Bug.CALCITE_4513_FIXED));
        return new HiveRelBuilder(Contexts.chain(context, confContext), cluster, schema);
      }
    };
  }
Creates a {@link RelBuilderFactory}, a partially-created RelBuilder.
Just add a {@link RelOptCluster} and a {@link RelOptSchema}
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelBuilder.java