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

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

                Author: ASF GitHub Bot
            Created on: 31/Oct/24 23:13
            Start Date: 31/Oct/24 23:13
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #4071:
URL: https://github.com/apache/gobblin/pull/4071#discussion_r1825270928


##########
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergTable.java:
##########
@@ -234,8 +234,7 @@ protected void registerIcebergTable(TableMetadata 
srcMetadata, TableMetadata dst
    *
    * @param icebergPartitionFilterPredicate the predicate to filter partitions
    * @return a list of data files that match the partition filter predicate
-   * @throws TableNotFoundException if error occurred while accessing the 
table metadata
-   * @throws RuntimeException if error occurred while reading the manifest file
+   * @throws IOException if error occurred while accessing the table metadata 
or reading the manifest file
    */
   public List<DataFile> getPartitionSpecificDataFiles(Predicate<StructLike> 
icebergPartitionFilterPredicate)
       throws IOException {

Review Comment:
   wouldn't the last line here also throw an NPE for the same reason?
   ```
     public List<DataFile> getPartitionSpecificDataFiles(Predicate<StructLike> 
icebergPartitionFilterPredicate)
         throws IOException {
       TableMetadata tableMetadata = accessTableMetadata();
       Snapshot currentSnapshot = tableMetadata.currentSnapshot();
       long currentSnapshotId = currentSnapshot.snapshotId();
   ```
   
   looking quickly at this class, there are several places that are not 
resilient to the unexpected circumstance of a table having existing and 
metadata, but not actually any snapshots yet.





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

    Worklog Id:     (was: 941225)
    Time Spent: 20m  (was: 10m)

> Fix NPE in overwritePartition
> -----------------------------
>
>                 Key: GOBBLIN-2169
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-2169
>             Project: Apache Gobblin
>          Issue Type: Bug
>            Reporter: Vivek Rai
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> While overwrite we log the snapshot id of last snapshot present before 
> commit, incase table has no previous snapshot it will give NPE
> Line giving NPE - 
> {code:java}
> log.info("~{}~ SnapshotId before overwrite: {}", tableId, 
> accessTableMetadata().currentSnapshot().snapshotId());{code}



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

Reply via email to