gravitino icon indicating copy to clipboard operation
gravitino copied to clipboard

[FEATURE] Requesting schema and table without catalog

Open taylor12805 opened this issue 1 year ago • 0 comments

Describe the feature

Need APIs to return table detailed information including catalog info (might be multiple) when requesting schema and table without catalog Below describe API request and response parameters: request -> (metalake, schema, table) response -> (catalog, schema, table info)

Motivation

We store tables with same table info in multiple catalogs so that we can 1) separate user access to multiple catalogs and 2) to recover from data center disaster. To get available catalogs containing specified schema.table, we have to iterator through all the catalogs to retrieve the list of available catalogs, which is quite inefficient. So we need an API to efficiently retrieve available catalogs matching requested (metalake, schema, table) parameters.

Describe the solution

  • API use wildcard character to denote any matching identifier(catalog, schema, etc.) in path: /metalakes/:metalake/catalogs/:catalogs/schemas/:schema/tables/:table so the request might containing wildcard catalog and the response is list of table containing catalog info
Path:
/metalakes/:metalake/catalogs/:catalogs/schemas/:schema/tables/:table

Request parameter:
(String metalake, String catalog = "*", String schema, String table)

Response:
List<Table>
  • Backend add function getTablePOByName in class TableMetaService to query table table_meta with tableName parameter
TableMetaService.java
List<TablePO> getTablePOByName(String tableName)

TableMetaSQLProviderFactory.java
List<String> selectTableIdByName(String name)

Additional context

No response

taylor12805 avatar Sep 06 '24 03:09 taylor12805