Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions docs/src/impls/polaris.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Lance Polaris Namespace

**Lance Polaris Namespace** is an implementation using Polaris Catalog's Generic Table API.
The Polaris namespace uses the following API endpoints:
- **Namespace operations**: Standard Iceberg REST API endpoints (`/namespaces`)
- **Table operations**: Generic Table API endpoints (`/namespaces/{namespace}/generic-tables`)

For more details about Polaris Catalog, please read the [Polaris Catalog Documentation](https://github.com/polaris-catalog/polaris).

## Configuration

The Lance Polaris namespace accepts the following configuration properties:

| Property | Required | Description | Default | Example |
|-------------------|----------|------------------------------------------------|---------|----------------------------|
| `endpoint` | Yes | Polaris server endpoint URL | | `http://localhost:8182` |
| `auth_token` | No | Bearer token for authentication | | `your-auth-token` |
| `connect_timeout` | No | Connection timeout in milliseconds | 10000 | `30000` |
| `read_timeout` | No | Read timeout in milliseconds | 30000 | `60000` |
| `max_retries` | No | Maximum number of retries for failed requests | 3 | `5` |

### Authentication

The Polaris namespace supports bearer token authentication:

1. **Bearer Token**: Set `auth_token` with a valid Polaris access token
2. **No Authentication**: For local or unsecured Polaris deployments

## Namespace Mapping

Polaris provides a flexible namespace hierarchy:

- A catalog in Polaris maps to the first level Lance namespace
- Nested namespaces in Polaris map to subsequent Lance namespace levels
- Polaris supports arbitrary nesting depth, allowing flexible namespace organization

## Table Definition

A Lance table appears as a [Generic Table](https://github.com/polaris-catalog/polaris/blob/main/spec/polaris-catalog-apis/generic-tables-api.yaml)
object in Polaris with the following requirements:

1. the `format` must be set to `lance` to indicate this is a Lance table
2. the `base-location` must point to the root location of the Lance table
3. the `doc` field can be used to store an optional table description
4. the `properties` must follow:
1. there is a key `table_type` set to `lance` (case insensitive)
2. there is a key `managed_by` set to either `storage` or `impl` (case insensitive). If not set, default to `storage`
3. there is a key `version` set to the latest numeric version number of the table. This field will only be respected if `managed_by=impl`

## Requirement for Implementation Managed Table

Updates to implementation-managed Lance tables must use Polaris's table versioning mechanism
for conditional updates through the UpdateTable API. The `version` property must be updated atomically
to prevent concurrent modification conflicts.
83 changes: 83 additions & 0 deletions java/lance-namespace-polaris/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.lancedb</groupId>
<artifactId>lance-namespace-root</artifactId>
<version>0.0.7</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>lance-namespace-polaris</artifactId>
<packaging>jar</packaging>

<name>Lance Namespace Polaris</name>
<description>Polaris Catalog implementation for Lance namespace management</description>

<dependencies>
<dependency>
<groupId>com.lancedb</groupId>
<artifactId>lance-namespace-core</artifactId>
<version>${lance-namespace.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Loading
Loading