You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/03/31 17:39:30 UTC

[GitHub] [iceberg] kbendick commented on a change in pull request #2379: Compaction Strategies

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



##########
File path: core/src/main/java/org/apache/iceberg/spark/actions/compaction/BinningCompactionStrategy.java
##########
@@ -0,0 +1,91 @@
+/*
+ * 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.spark.actions.compaction;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.iceberg.FileScanTask;
+import org.apache.iceberg.actions.compaction.DataCompactionStrategy;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet;
+import org.apache.iceberg.util.BinPacking;
+import org.apache.iceberg.util.PropertyUtil;
+
+import static org.apache.iceberg.util.StreamUtil.streamOf;
+
+/**
+ * A Compaction strategy for rewriting files based on their sizes, the goal is to end up with files
+ * whose size is close to the Target Size as specified in this strategy's options.
+ */
+public abstract class BinningCompactionStrategy implements DataCompactionStrategy {
+
+
+  public static final String TARGET_SIZE_OPTION = "target_size";
+  public static final String TARGET_THRESHOLD_OPTION = "target_threshold";
+
+  // TODO Maybe these should be global?
+  public static final String MAX_JOB_SIZE_OPTION = "max_job_size";

Review comment:
       Should we consider name-spacing some of these configurations (like we do for table properties such as `write.split.*`? Maybe something like `compaction.binning.target_size` or just `compaction.*`.
   
   I see we don't do that for any of the current actions that are called as stored procedures, so this might have already been discussed or it might be a larger discussion around actions in general and whether or not we'd like to allow for default options to be set which deviate from the values we choose as defaults.
   
   This possibly ties into the consideration of a global configuration for `max_job_size`.




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org