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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to