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

   1. create a new empty iceberg table using Spark3.3
   `create table testicespark(id int) using iceberg;`
   
   2. create a brancn on the empty table:
   `alter table hivedblake.testicespark create branch "branch1";`
   
   3. NullPointerException
   ```
   ERROR SparkSQLDriver: Failed in [alter table testicespark create branch 
testbranch]
   java.lang.NullPointerException
           at 
org.apache.spark.sql.execution.datasources.v2.CreateOrReplaceBranchExec.$anonfun$run$1(CreateOrReplaceBranchExec.scala:44)
           at 
scala.runtime.java8.JFunction0$mcJ$sp.apply(JFunction0$mcJ$sp.java:23)
           at scala.Option.getOrElse(Option.scala:189)
           at 
org.apache.spark.sql.execution.datasources.v2.CreateOrReplaceBranchExec.run(CreateOrReplaceBranchExec.scala:44)
           at 
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result$lzycompute(V2CommandExec.scala:43)
           at 
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result(V2CommandExec.scala:43)
           at 
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.executeCollect(V2CommandExec.scala:49)
   ....
   ```
   
   
   I think we should throw a friendly exception if table is empty instead of 
null exception when creating branch.


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