openinx commented on a change in pull request #2064: URL: https://github.com/apache/iceberg/pull/2064#discussion_r560643997
########## File path: api/src/main/java/org/apache/iceberg/DistributionMode.java ########## @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.iceberg; + +/** + * Enum of supported write distribution mode, it defines the write behavior of batch or streaming job: + * <p> + * 1. none: don't shuffle rows. It is suitable for scenarios where the rows are located in only few + * partitions, otherwise that may produce too many small files because each task is writing rows into different + * partitions randomly. + * <p> + * 2. hash-partition: hash distribute by partition keys, which is suitable for the scenarios where the rows are located + * into different partitions evenly. + * <p> + * 3. range-partition: range distribute by partition key (or sort key if table has an {@link SortOrder}), which is + * suitable for the scenarios where rows are located into different partitions with skew distribution. + */ +public enum DistributionMode { + NONE("none"), HASH("hash-partition"), RANGE("range-partition"); Review comment: @stevenzwu , I think `write.shuffle-mode` is enough to express the write behavior of flink, but not enough to express the write behavior of spark, because spark will distribute those records with local sort or global sort. +1 on keeping `write.distribution-mode` and using the `hash` & `range` values now ( Though the `range` does not fully express the sort meaning from spark, but I can not think of a better word to express the exact meaning for both flink and spark ). ---------------------------------------------------------------- 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: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
