Skip to content

Commit 969eb88

Browse files
committed
Document Iceberg view location property
Add an Iceberg views section describing the `location` view property for JDBC catalogs using schema version V1 and REST catalogs with view endpoints enabled. Include a CREATE VIEW example and mention SHOW CREATE VIEW for checking the current location.
1 parent 7aa62d0 commit 969eb88

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

docs/src/main/sphinx/connector/iceberg.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,43 @@ WITH (
11871187
partitioning = ARRAY['"parent.child1"']);
11881188
```
11891189

1190+
(iceberg-views)=
1191+
#### Views
1192+
1193+
Iceberg catalogs that support views provide {ref}`sql-view-management`. When
1194+
creating a view in JDBC catalogs using schema version `V1` or REST catalogs with
1195+
view endpoints enabled, the `location` view property can be passed to the
1196+
connector using a `WITH` clause in {doc}`/sql/create-view`.
1197+
1198+
:::{list-table} Iceberg view properties
1199+
:widths: 40, 60
1200+
:header-rows: 1
1201+
1202+
* - Property name
1203+
- Description
1204+
* - `location`
1205+
- Optionally specifies the file system location URI for the view metadata
1206+
files. This property is supported only for Iceberg JDBC catalogs using
1207+
schema version `V1` and REST catalogs with view endpoints enabled.
1208+
:::
1209+
1210+
The view definition below specifies a file system location for the view metadata
1211+
files:
1212+
1213+
```sql
1214+
CREATE VIEW recent_orders
1215+
WITH (location = 's3://my-bucket/example/views/recent_orders')
1216+
AS
1217+
SELECT *
1218+
FROM orders
1219+
WHERE orderdate >= DATE '2024-01-01';
1220+
```
1221+
1222+
When creating a new view and the `location` view property is omitted, the view
1223+
metadata files are stored in the default location for the view. The current
1224+
value of the `location` property can be shown using {doc}`SHOW CREATE VIEW
1225+
</sql/show-create-view>`.
1226+
11901227
(iceberg-metadata-tables)=
11911228
#### Metadata tables
11921229

0 commit comments

Comments
 (0)