dixingxing0 commented on a change in pull request #2609:
URL: https://github.com/apache/iceberg/pull/2609#discussion_r634878319



##########
File path: core/src/main/java/org/apache/iceberg/actions/SortStrategy.java
##########
@@ -0,0 +1,136 @@
+/*
+ * 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.actions;
+
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.Set;
+import org.apache.iceberg.FileScanTask;
+import org.apache.iceberg.SortOrder;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
+import org.apache.iceberg.relocated.com.google.common.collect.FluentIterable;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet;
+import org.apache.iceberg.util.PropertyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A rewrite strategy for data files which aims to reorder data with data 
files to optimally lay them out
+ * in relation to a column. For example, if the Sort strategy is used on a set 
of files which is ordered
+ * by column x and original has files File A (x: 0 - 50), File B ( x: 10 - 40) 
and File C ( x: 30 - 60),
+ * this Strategy will attempt to rewrite those files into File A' (x: 0-20), 
File B' (x: 21 - 40),
+ * File C' (x: 41 - 60).
+ * <p>
+ * Currently the there is no clustering detection and we will rewrite all 
files if {@link SortStrategy#REWRITE_ALL}
+ * is true (default). If this property is disabled any files with the 
incorrect sort-order as well as any files
+ * that would be chosen by {@link BinPackStrategy} will be rewrite candidates.
+ * <p>
+ * In the future other algorithms for determining files to rewrite will be 
provided.
+ */
+abstract class SortStrategy extends BinPackStrategy {
+  private static final Logger LOG = 
LoggerFactory.getLogger(SortStrategy.class);
+
+  /**
+   * Rewrites all files, regardless of their size. Defaults to false, 
rewriting only wrong sort-order and mis-sized
+   * files;
+   */
+  public static final String REWRITE_ALL = "no-size-filter";
+  public static final boolean REWRITE_ALL_DEFAULT = false;

Review comment:
       Curious about this, `REWRITE_ALL_DEFAULT = false`, but  java doc says : 
   ```
    Currently the there is no clustering detection and we will rewrite all 
files if {@link SortStrategy#REWRITE_ALL} * is true (default).
   ```




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

Reply via email to