dramaticlly opened a new pull request, #7652:
URL: https://github.com/apache/iceberg/pull/7652

   This fix help throw proper validation exception instead of 
NullPointerException when create branch or tag on iceberg table without any 
snapshot. 
   
   ## Before
   ```scala
   
   Before
   ```scala
   scala> val snapshotId = 
branchOptions.snapshotId.getOrElse(table.currentSnapshot().snapshotId())
   java.lang.NullPointerException
     at $anonfun$res38$1(<console>:47)
     at scala.runtime.java8.JFunction0$mcJ$sp.apply(JFunction0$mcJ$sp.java:23)
     at scala.Option.getOrElse(Option.scala:189)
     ... 51 elided
   ```
   
   
   After
   ```scala
   scala> val snapshotId: java.lang.Long = branchOptions.snapshotId
             
.orElse(Option(iceberg.table.currentSnapshot()).map(_.snapshotId()))
             .map(java.lang.Long.valueOf)
             .orNull
   snapshotId: Long = null
   ```
   
   CC @amogh-jahagirdar @zhangbutao 
   
   


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