You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/polaris.md
+42-29Lines changed: 42 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ This document describes how the Polaris Catalog implements the Lance Namespace c
6
6
7
7
Apache Polaris is an open-source catalog implementation for Apache Iceberg that provides a REST API for managing tables and namespaces. Polaris supports the Generic Table API which allows registering non-Iceberg table formats. For details on Polaris Catalog, see the [Polaris Catalog Documentation](https://polaris.apache.org).
8
8
9
+
**Note:** The Generic Table API is available in Polaris 1.2.0-incubating and later versions. Ensure your Polaris deployment is running a compatible version.
The Lance Polaris namespace implementation accepts the following configuration properties:
@@ -24,11 +26,14 @@ The **max_retries** property is optional and specifies the maximum number of ret
24
26
25
27
### Namespace
26
28
27
-
The **root namespace**is represented by the Polaris catalog root, accessed via the `/namespaces` endpoint.
29
+
The **namespace identifier**follows a hierarchical structure where the first level represents the Polaris catalog (warehouse), and subsequent levels represent namespaces within that catalog. For example, `my_catalog.my_schema` refers to namespace `my_schema` in catalog `my_catalog`.
28
30
29
-
A **child namespace** is a nested namespace in Polaris. Polaris supports arbitrary nesting depth, allowing flexible namespace organization. First-level namespaces typically represent catalogs, with subsequent levels representing schemas or other organizational units.
31
+
A **child namespace** is a nested namespace in Polaris. Polaris supports arbitrary nesting depth, allowing flexible namespace organization within a catalog.
30
32
31
-
The **namespace identifier** is constructed by joining namespace levels with the `.` delimiter (e.g., `catalog.schema`). When making API calls, the namespace path is URL-encoded.
33
+
The **namespace identifier** is constructed by joining the catalog and namespace levels with the `.` delimiter (e.g., `catalog.schema.subschema`). When making API calls:
34
+
- The catalog is extracted as the first level
35
+
- Remaining levels form the namespace path within that catalog
36
+
- The namespace path is URL-encoded using `.` as the separator
32
37
33
38
**Namespace properties** are stored in the namespace's properties map, returned by the Polaris namespace API.
34
39
@@ -54,10 +59,11 @@ Creates a new namespace in Polaris.
54
59
55
60
The implementation:
56
61
57
-
1. Parse the namespace identifier to get the namespace path
58
-
2. Construct a CreateNamespaceRequest with the namespace array and properties
59
-
3. POST to `/namespaces` endpoint
60
-
4. Return the created namespace properties
62
+
1. Parse the namespace identifier to extract the catalog (first level) and namespace levels
63
+
2. Validate that at least 2 levels are provided (catalog + namespace)
64
+
3. Construct a CreateNamespaceRequest with the namespace array and properties
65
+
4. POST to `/api/catalog/v1/{catalog}/namespaces` endpoint
66
+
5. Return the created namespace properties
61
67
62
68
**Error Handling:**
63
69
@@ -69,10 +75,11 @@ Lists child namespaces under a given parent namespace.
69
75
70
76
The implementation:
71
77
72
-
1. Parse the parent namespace identifier
73
-
2. For root namespace: GET `/namespaces`
74
-
3. For nested namespace: GET `/namespaces/{parent}/namespaces`
75
-
4. Convert the response namespace arrays to dot-separated strings
78
+
1. Parse the parent namespace identifier to extract the catalog (first level)
79
+
2. Validate that at least 1 level (catalog) is provided
80
+
3. For catalog-level listing: GET `/api/catalog/v1/{catalog}/namespaces`
81
+
4. For nested namespace listing: GET `/api/catalog/v1/{catalog}/namespaces/{parent}/namespaces`
82
+
5. Convert the response namespace arrays to dot-separated strings, prefixing with the catalog name
76
83
77
84
**Error Handling:**
78
85
@@ -84,9 +91,10 @@ Retrieves properties and metadata for a namespace.
84
91
85
92
The implementation:
86
93
87
-
1. Parse the namespace identifier
88
-
2. GET `/namespaces/{namespace}` with URL-encoded namespace path
89
-
3. Return the namespace properties
94
+
1. Parse the namespace identifier to extract the catalog (first level) and namespace path
95
+
2. Validate that at least 2 levels are provided (catalog + namespace)
96
+
3. GET `/api/catalog/v1/{catalog}/namespaces/{namespace}` with URL-encoded namespace path
97
+
4. Return the namespace properties
90
98
91
99
**Error Handling:**
92
100
@@ -98,8 +106,9 @@ Removes a namespace from Polaris. Only RESTRICT mode is supported; CASCADE mode
98
106
99
107
The implementation:
100
108
101
-
1. Parse the namespace identifier
102
-
2. DELETE `/namespaces/{namespace}` with URL-encoded namespace path
109
+
1. Parse the namespace identifier to extract the catalog (first level) and namespace path
110
+
2. Validate that at least 2 levels are provided (catalog + namespace)
111
+
3. DELETE `/api/catalog/v1/{catalog}/namespaces/{namespace}` with URL-encoded namespace path
103
112
104
113
**Error Handling:**
105
114
@@ -115,15 +124,16 @@ Declares a new Lance table in Polaris without creating the underlying data.
115
124
116
125
The implementation:
117
126
118
-
1. Parse the table identifier to extract namespace and table name
119
-
2. Construct a CreateGenericTableRequest with:
127
+
1. Parse the table identifier to extract catalog (first level), namespace (middle levels), and table name (last level)
128
+
2. Validate that at least 3 levels are provided (catalog + namespace + table)
129
+
3. Construct a CreateGenericTableRequest with:
120
130
-`name`: the table name
121
131
-`format`: `lance`
122
132
-`base-location`: the specified location
123
133
-`doc`: optional description from properties
124
134
-`properties`: table properties including `table_type=lance`
125
-
3. POST to `/namespaces/{namespace}/generic-tables`
126
-
4. Return the created table location and properties
135
+
4. POST to `/api/catalog/polaris/v1/{catalog}/namespaces/{namespace}/generic-tables`
136
+
5. Return the created table location and properties
127
137
128
138
**Error Handling:**
129
139
@@ -135,9 +145,10 @@ Lists all Lance tables in a namespace.
135
145
136
146
The implementation:
137
147
138
-
1. Parse the namespace identifier
139
-
2. GET `/namespaces/{namespace}/generic-tables`
140
-
3. Extract table names from the response identifiers
148
+
1. Parse the namespace identifier to extract the catalog (first level) and namespace path
149
+
2. Validate that at least 2 levels are provided (catalog + namespace)
150
+
3. GET `/api/catalog/polaris/v1/{catalog}/namespaces/{namespace}/generic-tables`
151
+
4. Extract table names from the response identifiers
141
152
142
153
**Error Handling:**
143
154
@@ -149,10 +160,11 @@ Retrieves metadata for a Lance table. Only `load_detailed_metadata=false` is sup
149
160
150
161
The implementation:
151
162
152
-
1. Parse the table identifier to extract namespace and table name
153
-
2. GET `/namespaces/{namespace}/generic-tables/{table}`
154
-
3. Verify the table format is `lance`
155
-
4. Return the table location from `base-location` and storage_options from `properties`
163
+
1. Parse the table identifier to extract catalog (first level), namespace (middle levels), and table name (last level)
164
+
2. Validate that at least 3 levels are provided (catalog + namespace + table)
165
+
3. GET `/api/catalog/polaris/v1/{catalog}/namespaces/{namespace}/generic-tables/{table}`
166
+
4. Verify the table format is `lance`
167
+
5. Return the table location from `base-location` and storage_options from `properties`
156
168
157
169
**Error Handling:**
158
170
@@ -168,8 +180,9 @@ Removes a Lance table registration from Polaris without deleting the underlying
168
180
169
181
The implementation:
170
182
171
-
1. Parse the table identifier to extract namespace and table name
0 commit comments