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
50 changes: 50 additions & 0 deletions docs/src/impls/gravitino.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Lance Gravitino Namespace

**Lance Gravitino Namespace** is an implementation using Apache Gravitino Catalog.
For more details about Apache Gravitino, please read the [Gravitino Documentation](https://gravitino.apache.org/).

## Configuration

The Lance Gravitino namespace accepts the following configuration properties:

| Property | Required | Description | Default | Example |
|---------------------|----------|----------------------------------------------------------------|---------------------------|-----------------------------------|
| `endpoint` | No | Gravitino server endpoint URL | `http://localhost:8090` | `http://gravitino.example.com` |
| `auth_token` | No | Bearer token for authentication | | `eyJhbGciOiJIUzI1...` |
| `connect_timeout` | No | HTTP connection timeout in seconds | 10 | `30` |
| `read_timeout` | No | HTTP read timeout in seconds | 60 | `120` |
| `max_retries` | No | Maximum number of retries for failed requests | 3 | `5` |

### Authentication

The Gravitino namespace supports the following authentication methods:

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

## Namespace Mapping

Apache Gravitino provides a 4-level namespace hierarchy:

- A metalake in Gravitino maps to the first level Lance namespace
- A catalog within the metalake maps to the second level Lance namespace
- A schema (database) in Gravitino maps to the third level Lance namespace
- Together they form a 4-level Lance namespace structure matching Gravitino's hierarchy

## Table Definition

A Lance table appears as a [Table](https://github.com/apache/gravitino/blob/main/docs/open-api/tables.yaml)
object in Gravitino with the following requirements:

1. the table `name` identifies the table within its schema
2. the `columns` must be provided with the table schema converted from Lance's Arrow schema to Gravitino's column format
3. the `properties` must follow:
1. there is a key `format` set to `lance` to identify this as a Lance table
2. there is a key `provider` set to `lance` to specify the data provider
3. there is a key `location` pointing to the storage location of the Lance table data

## Requirement for Implementation Managed Table

Updates to implementation-managed Lance tables must use Gravitino's table versioning mechanism
for conditional updates through the UpdateTable API. The table properties must be updated atomically
to prevent concurrent modification conflicts.
101 changes: 101 additions & 0 deletions java/lance-namespace-gravitino/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<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-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>lance-namespace-gravitino</artifactId>
<packaging>jar</packaging>
<name>Lance Namespace Gravitino Integration</name>
<description>Gravitino catalog implementation for Lance namespace management</description>

<properties>
<jackson.version>2.15.2</jackson.version>
<httpclient5.version>5.2.1</httpclient5.version>
</properties>

<dependencies>
<!-- Lance Namespace Core -->
<dependency>
<groupId>com.lancedb</groupId>
<artifactId>lance-namespace-core</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<!-- Jackson for JSON -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
</dependency>

<!-- Apache Arrow -->
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-vector</artifactId>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
</dependency>

<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<version>2.35.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Loading
Loading