[ 
https://issues.apache.org/jira/browse/GOBBLIN-2159?focusedWorklogId=938561&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-938561
 ]

ASF GitHub Bot logged work on GOBBLIN-2159:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Oct/24 04:48
            Start Date: 17/Oct/24 04:48
    Worklog Time Spent: 10m 
      Work Description: Blazer-007 commented on code in PR #4058:
URL: https://github.com/apache/gobblin/pull/4058#discussion_r1804099396


##########
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/predicates/IcebergPartitionFilterPredicateUtil.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * 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.gobblin.data.management.copy.iceberg.predicates;
+
+import java.util.List;
+
+import org.apache.iceberg.PartitionField;
+import org.apache.iceberg.TableMetadata;
+
+/**
+ * Utility class for creating and managing partition filter predicates for 
Iceberg tables.
+ * <p>
+ * This class provides methods to retrieve the index of a partition column in 
the table metadata
+ * and ensures that the partition transform is supported.
+ * </p>
+ * <p>
+ * Note: This class is not meant to be instantiated.
+ * </p>
+ */
+public class IcebergPartitionFilterPredicateUtil {
+  private IcebergPartitionFilterPredicateUtil() {
+  }
+
+  /**
+   * Retrieves the index of the partition column from the partition spec in 
the table metadata.
+   *
+   * @param partitionColumnName the name of the partition column to find
+   * @param tableMetadata the metadata of the Iceberg table
+   * @param supportedTransforms a list of supported partition transforms
+   * @return the index of the partition column if found, otherwise -1
+   * @throws IllegalArgumentException if the partition transform is not 
supported
+   */
+  public static int getPartitionColumnIndex(

Review Comment:
   Currently it looks like that but in future we will need more filter 
predicates and every filter will need the partition column index, so i believe 
keeping it separate for now should be fine , maybe we can put this in factory 
class itself or convert this class to factory class





Issue Time Tracking
-------------------

    Worklog Id:     (was: 938561)
    Time Spent: 4h 50m  (was: 4h 40m)

> Support Partition Based Copy in Iceberg Distcp
> ----------------------------------------------
>
>                 Key: GOBBLIN-2159
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-2159
>             Project: Apache Gobblin
>          Issue Type: Task
>            Reporter: Vivek Rai
>            Priority: Major
>          Time Spent: 4h 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to