Skip to content

Make location in TableCreation optional #67

Closed

Description

@Xuanwo

I'm not sure, but wouldn't it be more natural for Catalog to manage the location of the table and the table metadata itself?
If so, the location field of the TableCreation struct would better be deleted, or at least made Optional.
(For now, I'm thinking about ignoring that field when test-implementing the function.)

Thanks.

Originally posted by @zeodtr in #54 (comment)

Activity

  1. Xuanwo commented on Sep 26, 2023

    @Xuanwo
    MemberAuthor

    What do you think? cc @Fokko @liurenjie1024 @JanKaul

  2. JanKaul commented on Sep 26, 2023

    @JanKaul
    Collaborator

    Did I understand correctly that the location field in the TableCreation struct relates to the location field in the table-metadata?

    If so, I would manage the location as part of the table metadata. If we aim to create v2 iceberg tables by default, I think the field should not be optional. It we want to enable the creation of v1 tables we could make it optional.

  3. JanKaul commented on Sep 26, 2023

    @JanKaul
    Collaborator

    @zeodtr What kind of catalog are you trying to implement?

  4. Xuanwo commented on Sep 26, 2023

    @Xuanwo
    MemberAuthor

    Did I understand correctly that the location field in the TableCreation struct relates to the location field in the table-metadata?

    Do I understand correctly that @zeodtr's idea is to have the location field in the table-metadata managed by the catalog, making it optional for the catalog to determine the actual location?

  5. zeodtr commented on Sep 26, 2023

    @zeodtr

    @zeodtr What kind of catalog are you trying to implement?

    What I'm thinking is as explained by @Xuanwo:

    Do I understand correctly that @zeodtr's idea is to have the location field in the table-metadata managed by the catalog, making it optional for the catalog to determine the actual location?

    I'm trying to implement a Catalog that manages the table and table metadata by itself, including where to store/retrieve them.
    So, the Catalog wants to determine the location by itself, rather than take it as an argument.
    (Edited: 'itself' to 'by itself')

  6. JanKaul commented on Sep 26, 2023

    @JanKaul
    Collaborator

    Ah okay, now I get it. Thanks for the explanation.

    I'm not really sure what the implications of this are. I think the iceberg crate still has to assume that the location is not managed by the catalog in general.

  7. liurenjie1024 commented on Sep 27, 2023

    @liurenjie1024
    Contributor

    I think by the openapi spec also says location field is optional:
    https://github.com/apache/iceberg/blob/621d301b17417af4b71a0e8c93db9db6f8266839/open-api/rest-catalog-open-api.yaml#L1948

    And it's reasonable to make it optional since a catalog may decide the directory layout of all tables by itself.

  8. Fokko commented on Sep 27, 2023

    @Fokko
    Contributor

    I'm not really sure what the implications of this are. I think the iceberg crate still has to assume that the location is not managed by the catalog in general.

    I think this comment by @JanKaul summarizes the issue. The answer to the question is: it depends.

    For the REST catalog, the metadata is managed by the catalog. For the rest (Hive, Glue, Dynamo, SQL etc) the metadata is managed by the crate. I think it is reasonable to make it optional.

    In PyIceberg it is still required, but that's mostly since we haven't seen any situation where it was missing.

  9. self-assigned this
    on Oct 13, 2023
  10. Xuanwo commented on Oct 13, 2023

    @Xuanwo
    MemberAuthor

    I'm going to make this change.

  11. added
    good first issue
    on Nov 27, 2024
  12. Fokko commented on Nov 27, 2024

    @Fokko
    Contributor

    Yes, so the location is not set when you stage-create a table. In the REST catalog you can stage-create a table, where you first send out the create-table request. You'll get a response, but there is no metadata yet. The response can contain credentials to configure your FileIO, and you can write out your datafiles and manifests. Then you can do the snapshot commit and then the table will appear in the catalog.

  13. reneleonhardt commented on Jul 15, 2025

    @reneleonhardt

    @Xuanwo Can this be closed?
    TableCreation::location is optional since Nov 2023 😅

  14. liurenjie1024 commented on Jul 16, 2025

    @liurenjie1024
    Contributor

    Thanks @reneleonhardt for the update, I think it's fine to close it now.

  15. reneleonhardt commented on Jul 16, 2025

    @reneleonhardt

    No prob, maybe you can mark more good-first-issue because all have been taken for months 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions