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/02/01 11:40:24 UTC

[GitHub] [iceberg] vvellanki commented on a change in pull request #2182: Support for PartitionStatsFile in each snapshot

vvellanki commented on a change in pull request #2182:
URL: https://github.com/apache/iceberg/pull/2182#discussion_r567738918



##########
File path: core/src/main/java/org/apache/iceberg/PartitionStatsMap.java
##########
@@ -0,0 +1,87 @@
+/*
+ * 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;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+
+/**
+ * @ParitionStatsMap Instance of this class holds updated delta information, this can be used for both delete and
+ * inserts.
+ */
+public class PartitionStatsMap {
+  private final Map<Integer, PartitionSpec> specsById;
+
+  private Map<Integer, PartitionsTable.PartitionMap> partitionSpecMap = Maps.newHashMap();
+  private Set<Integer> partitionSpecUpdated = new HashSet<>();
+
+  public PartitionStatsMap(Map<Integer, PartitionSpec> specsById) {
+    this.specsById = specsById;
+  }
+
+  void put(int partitionSpecId, StructLike pd, DataFile dataFile) {

Review comment:
       Not synchronised?

##########
File path: core/src/main/java/org/apache/iceberg/SnapshotProducer.java
##########
@@ -150,6 +153,44 @@ protected void validate(TableMetadata currentMetadata) {
    */
   protected abstract List<ManifestFile> apply(TableMetadata metadataToUpdate);
 
+  /**
+  Implementation of this method update stats for each partition and
+  returns Map which defines partition specification for which udpates happen
+  Map Key: Partition Specification Id Map Value: New location of partition Stats file
+   */
+  protected Map<Integer, String> updatePartitionStats() {

Review comment:
       This looks wierd, why is an update method not doing anything?




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