Apache Iceberg version
1.11.0 (latest release)
Query engine
Spark
Please describe the bug 馃悶
Iceberg v3 introduces the unknown data type to gracefully represent columns without physical storage (such as Spark's VOID / all-null columns). However, attempting to lazily evolve an unknown column into a concrete primitive type (e.g., STRING) using Spark SQL's ALTER TABLE ... ALTER COLUMN ... TYPE statement fails during logical plan execution.
TypePromotion.canPromote() in Iceberg currently does not handle promotions from UnknownType to primitive types during schema evolution validation, resulting in an IllegalArgumentException
Steps to Reproduce:
spark.sql("CREATE DATABASE IF NOT EXISTS ds2_standalone.iceberg_v3_qe")
spark.sql("DROP TABLE IF EXISTS ds2_standalone.iceberg_v3_qe.table1")
spark.sql("CREATE TABLE ds2_standalone.iceberg_v3_qe.table1 (id INT, payload VOID) USING ICEBERG TBLPROPERTIES ('format-version'='3')")
spark.sql("INSERT INTO ds2_standalone.iceberg_v3_qe.table1 (id) VALUES (1), (2)")
spark.sql("SELECT payload FROM ds2_standalone.iceberg_v3_qe.table1").show()
spark.sql("ALTER TABLE ds2_standalone.iceberg_v3_qe.table1 ALTER COLUMN payload TYPE STRING") ## Fails here!
Error:
The job crashes during logical plan execution with: java.lang.IllegalArgumentException: Unsupported table change: Cannot change column type: payload: unknown -> string
Willingness to contribute
Apache Iceberg version
1.11.0 (latest release)
Query engine
Spark
Please describe the bug 馃悶
Iceberg v3 introduces the unknown data type to gracefully represent columns without physical storage (such as Spark's VOID / all-null columns). However, attempting to lazily evolve an unknown column into a concrete primitive type (e.g., STRING) using Spark SQL's ALTER TABLE ... ALTER COLUMN ... TYPE statement fails during logical plan execution.
TypePromotion.canPromote() in Iceberg currently does not handle promotions from UnknownType to primitive types during schema evolution validation, resulting in an IllegalArgumentException
Steps to Reproduce:
Error:
The job crashes during logical plan execution with: java.lang.IllegalArgumentException: Unsupported table change: Cannot change column type: payload: unknown -> stringWillingness to contribute