kbendick commented on a change in pull request #3213:
URL: https://github.com/apache/iceberg/pull/3213#discussion_r721874293



##########
File path: core/src/main/java/org/apache/iceberg/util/SmallFileUtil.java
##########
@@ -0,0 +1,145 @@
+/*
+ * 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.util;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import org.apache.iceberg.DataFile;
+import org.apache.iceberg.FileScanTask;
+import org.apache.iceberg.Table;
+import org.apache.iceberg.TableProperties;
+import org.apache.iceberg.io.CloseableIterable;
+import org.apache.iceberg.relocated.com.google.common.collect.Lists;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SmallFileUtil {
+  private static final Logger LOG = 
LoggerFactory.getLogger(SmallFileUtil.class);
+
+  private SmallFileUtil() {
+
+  }
+
+  /**
+   * Returns whether small files should be merged.
+   */
+  public static boolean shouldMergeSmallFiles(Table table) {

Review comment:
       Presently, users can bin-pack data using Spark. I believe it uses a 
threshold on the lower bound that's not a simple check if the file is smaller 
than the small file size, but some fraction of a target size.
   
   A simple size check might be best here, but it would be great if the 
continuous Flink action could compact files in a way that would return results 
that wouldn't be further changed by calling the Spark size based bin-packing 
action (haven't checked yet if that's the case here but wanted to draw your 
attention to that).
   
   I'd love to hear other's opinions on this though 🙂




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

To unsubscribe, e-mail: [email protected]

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