Skip to content

Commit

Permalink
Clarify register_table requirement
Browse files Browse the repository at this point in the history
- Add info that it has to be enabled in the catalog
- Delta Lake and Iceberg connectors
  • Loading branch information
mosabua committed May 29, 2024
1 parent 69a5a3f commit e44ab7f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
13 changes: 7 additions & 6 deletions docs/src/main/sphinx/connector/delta-lake.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ values. Typical usage does not require you to configure them.
- Use randomized, unique table locations.
- `true`
* - `delta.register-table-procedure.enabled`
- Enable to allow users to call the `register_table` procedure.
- Enable to allow users to call the [`register_table` procedure](delta-lake-register-table).
- `false`
* - `delta.vacuum.min-retention`
- Minimum retention threshold for the files taken into account for removal by
Expand Down Expand Up @@ -444,14 +444,14 @@ CALL examplecatalog.system.example_procedure()
(delta-lake-register-table)=
#### Register table

The connector can register table into the metastore with existing transaction
logs and data files.
The connector can register existing Delta Lake tables into the metastore if
`delta.register-table-procedure.enabled` is set to `true` for the catalog.

The `system.register_table` procedure allows the caller to register an
existing Delta Lake table in the metastore, using its existing transaction logs
and data files:

```
```sql
CALL example.system.register_table(schema_name => 'testdb', table_name => 'customer_orders', table_location => 's3://my-bucket/a/path')
```

Expand All @@ -462,12 +462,13 @@ default. The procedure is enabled only when
(delta-lake-unregister-table)=
#### Unregister table

The connector can unregister existing Delta Lake tables from the metastore.
The connector can remove existing Delta Lake tables from the metastore. Once
unregistered, you can no longer query the table from Trino.

The procedure `system.unregister_table` allows the caller to unregister an
existing Delta Lake table from the metastores without deleting the data:

```
```sql
CALL example.system.unregister_table(schema_name => 'testdb', table_name => 'customer_orders')
```

Expand Down
14 changes: 8 additions & 6 deletions docs/src/main/sphinx/connector/iceberg.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ implementation is used:
property is specified, it takes precedence over this catalog property.
- Empty
* - `iceberg.register-table-procedure.enabled`
- Enable to allow user to call `register_table` procedure.
- Enable to allow user to call [`register_table` procedure](iceberg-register-table).
- `false`
* - `iceberg.query-partition-filter-required`
- Set to `true` to force a query to use a partition filter. You can use the
Expand Down Expand Up @@ -456,13 +456,14 @@ CALL examplecatalog.system.example_procedure()
(iceberg-register-table)=
#### Register table

The connector can register existing Iceberg tables with the catalog.
The connector can register existing Iceberg tables into the metastore if
`iceberg.register-table-procedure.enabled` is set to `true` for the catalog.

The procedure `system.register_table` allows the caller to register an
existing Iceberg table in the metastore, using its existing metadata and data
files:

```
```sql
CALL example.system.register_table(schema_name => 'testdb', table_name => 'customer_orders', table_location => 'hdfs://hadoop-master:9000/user/hive/warehouse/customer_orders-581fad8517934af6be1857a903559d44')
```

Expand All @@ -471,7 +472,7 @@ metadata. This may be used to register the table with some specific table state,
or may be necessary if the connector cannot automatically figure out the
metadata version to use:

```
```sql
CALL example.system.register_table(schema_name => 'testdb', table_name => 'customer_orders', table_location => 'hdfs://hadoop-master:9000/user/hive/warehouse/customer_orders-581fad8517934af6be1857a903559d44', metadata_file_name => '00003-409702ba-4735-4645-8f14-09537cc0b2c8.metadata.json')
```

Expand All @@ -482,12 +483,13 @@ default. The procedure is enabled only when
(iceberg-unregister-table)=
#### Unregister table

The connector can unregister existing Iceberg tables from the catalog.
The connector can remove existing Iceberg tables from the metastore. Once
unregistered, you can no longer query the table from Trino.

The procedure `system.unregister_table` allows the caller to unregister an
existing Iceberg table from the metastores without deleting the data:

```
```sql
CALL example.system.unregister_table(schema_name => 'testdb', table_name => 'customer_orders')
```

Expand Down

0 comments on commit e44ab7f

Please sign in to comment.