You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/09/13 21:04:08 UTC

[GitHub] [iceberg] jackye1995 commented on pull request #2855: Add TableLocationSupplier for more flexible table placement

jackye1995 commented on pull request #2855:
URL: https://github.com/apache/iceberg/pull/2855#issuecomment-918574306


   My understanding is that you are trying to make the default table location a function of all the other table states, and make this function a potentially pluggable interface. 
   
   The biggest use case I see is for tables renamed to have the same name as an old table, they will still have a different path and not clobber the data if UUID is a part of the table path. Please let me know if there is any additional important use case that I missed.
   
   So to achieve this feature, I think another way is to have a different method in parallel to table builder's `withLocation(String newLoaction)` method called `withTableRootLocationProvider(String providerImpl)` (or this can be from table properties) to supply a root location provider. This provider is basically `Function<TableMetadataBuilder, String>`, and we will fill the null location value based on location provider in the table metadata builder.
   
   In the PR that Ryan referenced, I have changed to implement the `TableMetadataUpdateBuilder` that works specifically for the update metadata use case. Given this case, I think it now makes more sense to have a separated `TableMetadataBuilder` to create new table metadata, and we can initialize the location provider and resolve the location in the builder.
   
   To make this backwards compatible with existing implementations, we can remove the `defaultWarehouseLocation` method, and instead provide 2 implementations of the provider, which are `HiveTableRootLocationProvider` and `HadoopTableRootLocationProvider`, that should be able to cover all the existing use cases.


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