You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "rafoid (via GitHub)" <gi...@apache.org> on 2023/09/07 20:03:36 UTC
[GitHub] [iceberg] rafoid opened a new issue, #8522: ALTER TABLE ... DROP COLUMN allows dropping the last column of a table
rafoid opened a new issue, #8522:
URL: https://github.com/apache/iceberg/issues/8522
### Apache Iceberg version
1.3.1 (latest release)
### Query engine
None
### Please describe the bug 🐞
When performing ALTER TABLE ... DROP COLUMN, it drops columns as expected. However, the API also allows dropping the last column of a table, rendering the table useless. There are no more operations allowed on the table unless a new column is added.
I think we need to check whether the final schema has any columns or not before committing the changes.
--
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: issues-unsubscribe@iceberg.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rafoid commented on issue #8522: ALTER TABLE ... DROP COLUMN allows dropping the last column of a table
Posted by "rafoid (via GitHub)" <gi...@apache.org>.
rafoid commented on issue #8522:
URL: https://github.com/apache/iceberg/issues/8522#issuecomment-1710706057
I think we need to modify the `commit()` method as following:
```
@Override
public void commit() {
TableMetadata update = applyChangesToMetadata(base.updateSchema(apply(), lastColumnId));
if (update.schema().columns().size() == 0)
throw new UnsupportedOperationException("Unable to commit table without any columns.");
ops.commit(base, update);
}
```
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] ALTER TABLE ... DROP COLUMN allows dropping the last column of a table [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8522:
URL: https://github.com/apache/iceberg/issues/8522#issuecomment-2362459924
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org