Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iceberg: Alter column set data type fails for the complex types #16391

Closed
mayankvadariya opened this issue Mar 6, 2023 · 2 comments
Closed
Labels
enhancement New feature or request iceberg Iceberg connector

Comments

@mayankvadariya
Copy link
Contributor

Following statement fails with the given error.

CREATE TABLE t_row(c_row row(f1 varchar, f2 map(varchar, varchar)));
ALTER TABLE t_row ALTER COLUMN c_row SET DATA TYPE row(f1 varchar, f2 map(varchar, varchar), f3 varchar);
io.trino.spi.TrinoException: Failed to set column type: Cannot change type from map<string, string> to map<string, string>
  at io.trino.plugin.iceberg.IcebergMetadata.setColumnType(IcebergMetadata.java:1602)
  at io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata.setColumnType(ClassLoaderSafeConnectorMetadata.java:335)
  at io.trino.plugin.objectstore.ObjectStoreMetadata.setColumnType(ObjectStoreMetadata.java:541)
  at io.trino.metadata.MetadataManager.setColumnType(MetadataManager.java:752)
  at io.trino.execution.SetColumnTypeTask.execute(SetColumnTypeTask.java:103)
  at io.trino.execution.SetColumnTypeTask.execute(SetColumnTypeTask.java:49)
  at io.trino.execution.DataDefinitionExecution.start(DataDefinitionExecution.java:145)
  at io.trino.execution.SqlQueryManager.createQuery(SqlQueryManager.java:249)
  at io.trino.dispatcher.LocalDispatchQuery.lambda$startExecution$7(LocalDispatchQuery.java:146)
  at io.trino.$gen.Trino_407_55_ga0203e1____20230306_143023_2.run(Unknown Source)
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
  at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: java.lang.IllegalArgumentException: Cannot change type from map<string, string> to map<string, string>
  at io.trino.plugin.iceberg.IcebergMetadata.buildUpdateSchema(IcebergMetadata.java:1647)
  at io.trino.plugin.iceberg.IcebergMetadata.buildUpdateSchema(IcebergMetadata.java:1622)
  at io.trino.plugin.iceberg.IcebergMetadata.setColumnType(IcebergMetadata.java:1598)
  ... 12 more

Similarly below alter table also fails.

create table t_map(c_map map(varchar, varchar));
ALTER TABLE t_map ALTER COLUMN c_map SET DATA TYPE map(varchar, varchar);
@ebyhr
Copy link
Member

ebyhr commented Mar 6, 2023

That's a known limitation. Map and array types aren't supported for now.

@ebyhr ebyhr added enhancement New feature or request iceberg Iceberg connector labels Mar 6, 2023
@ebyhr
Copy link
Member

ebyhr commented Mar 8, 2023

#16248 will support adding f3 varchar field to c_row column in the description. Let me close.

@ebyhr ebyhr closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request iceberg Iceberg connector
Development

No branches or pull requests

2 participants