caican00 opened a new issue, #9163:
URL: https://github.com/apache/iceberg/issues/9163

   ### Apache Iceberg version
   
   1.4.0
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   
   Hi,
   
   I wanted to update the datatype of map key in a iceberg table, but I got an 
exception as follows:
   ```
   org.apache.spark.SparkException: Unsupported table change: Cannot update map 
keys: map<int, map<int, map<int, long>>>
     at 
org.apache.spark.sql.execution.datasources.v2.AlterTableExec.run(AlterTableExec.scala:40)
     at 
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result$lzycompute(V2CommandExec.scala:40)
     at 
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result(V2CommandExec.scala:40)
     at 
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.executeCollect(V2CommandExec.scala:46)
     at org.apache.spark.sql.Dataset.$anonfun$logicalPlan$1(Dataset.scala:228)
     at org.apache.spark.sql.Dataset.$anonfun$withAction$1(Dataset.scala:3694)
     at 
org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$5(SQLExecution.scala:105)
     at 
org.apache.spark.sql.execution.SQLExecution$.withSQLConfPropagated(SQLExecution.scala:165)
     at 
org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$1(SQLExecution.scala:90)
     at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:774)
     at 
org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:64)
     at org.apache.spark.sql.Dataset.withAction(Dataset.scala:3692)
     at org.apache.spark.sql.Dataset.<init>(Dataset.scala:228)
     at org.apache.spark.sql.Dataset$.$anonfun$ofRows$2(Dataset.scala:99)
     at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:774)
     at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:96)
     at org.apache.spark.sql.SparkSession.$anonfun$sql$1(SparkSession.scala:617)
     at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:774)
     at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:612)
     ... 47 elided
   Caused by: java.lang.IllegalArgumentException: Cannot update map keys: 
map<int, map<int, map<int, long>>>
     at org.apache.iceberg.SchemaUpdate$ApplyChanges.map(SchemaUpdate.java:697)
     at org.apache.iceberg.SchemaUpdate$ApplyChanges.map(SchemaUpdate.java:561)
     at org.apache.iceberg.types.TypeUtil.visit(TypeUtil.java:512)
     at org.apache.iceberg.types.TypeUtil.visit(TypeUtil.java:469)
     at org.apache.iceberg.types.TypeUtil.visit(TypeUtil.java:457)
     at org.apache.iceberg.SchemaUpdate.applyChanges(SchemaUpdate.java:539)
     at org.apache.iceberg.SchemaUpdate.apply(SchemaUpdate.java:441)
     at org.apache.iceberg.SchemaUpdate.commit(SchemaUpdate.java:448)
     at 
org.apache.iceberg.spark.SparkCatalog.commitChanges(SparkCatalog.java:540)
     at org.apache.iceberg.spark.SparkCatalog.alterTable(SparkCatalog.java:263)
     at org.apache.iceberg.spark.SparkCatalog.alterTable(SparkCatalog.java:99)
     at 
org.apache.spark.sql.execution.datasources.v2.AlterTableExec.run(AlterTableExec.scala:37)
     ... 65 more
   ```
   
   
![image](https://github.com/apache/iceberg/assets/94670132/d072f09d-24a1-49c0-b0f0-54bced2de44b)
   
   But, why prohibit updating the datatype of map key in iceberg? 


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