databend icon indicating copy to clipboard operation
databend copied to clipboard

Feature: Read-only attached tables (using last snapshot hint)

Open dantengsky opened this issue 1 year ago • 0 comments

Summary

Users who have an on-premises deployment of Databend may need to access on-premises tables in Databend Cloud, in a read-only manner:

  • All table data can be shared with Databend Cloud in a read-only manner
  • Mutations to tables, including data and schema changes, are executed and tracked within the user's on-premise platform.
  • Access to the user's meta server is restricted

we could enhance the attach table statement with extra options that indicate the above requirements, e.g.

ATTACH TABLE <target_table_name> 
  '<source-table-data-URI>' CONNECTION=(<connection_parameters>) 
  READ_ONLY

If the READ_ONLY parameter is provided, the target table should utilize the latest snapshot hint file stored at the specified source-table-data-URI, for both table data and schema, and target table can only be accessed in a read-only manner.

after PR# https://github.com/datafuselabs/databend/pull/13403, the sub task left is

  • [x] #13559

dantengsky avatar Oct 21 '23 08:10 dantengsky