Skip to content

Commit d6ad867

Browse files
authored
feat: add support of directory namespace and upgrade to 0.0.5 (#159)
1 parent 8ed985e commit d6ad867

116 files changed

Lines changed: 2789 additions & 798 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/java-lancedb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ jobs:
9494
LANCEDB_API_KEY: ${{ inputs.api_key || secrets.LANCEDB_CLOUD_API_KEY }}
9595
LANCEDB_REGION: ${{ inputs.region }}
9696
LANCEDB_HOST_OVERRIDE: ${{ inputs.host_override }}
97-
run: make build-java-lancedb
97+
run: make build-lancedb

docs/src/spec/impls/dir.md

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,59 @@ People can easily get started with creating and using Lance tables directly on t
55
local or remote storage system with a Lance directory namespace.
66

77
A directory namespace maps to a directory on storage, we call such directory a **namespace directory**.
8-
A Lance table corresponds to a subdirectory in the namespace directory.
9-
We call such a subdirectories **table directory**.
8+
A Lance table corresponds to a subdirectory in the namespace directory that has the format `<table_name>.lance`.
9+
We call such a subdirectory **table directory**.
1010
Consider the following example namespace directory layout:
1111

1212
```
1313
.
1414
└── /my/dir1/
15-
├── table1/
15+
├── table1.lance/
1616
│ ├── data/
1717
│ │ ├── 0aa36d91-8293-406b-958c-faf9e7547938.lance
1818
│ │ └── ed7af55d-b064-4442-bcb5-47b524e98d0e.lance
1919
│ ├── _versions/
2020
│ │ └── 9223372036854775707.manifest
21-
│ ├── _indices/
22-
│ │ └── 85814508-ed9a-41f2-b939-2050bb7a0ed5-fts/
23-
│ │ └── index.idx
24-
│ └── _deletions/
25-
│ └── 75c69434-cde5-4c80-9fe1-e79a6d952fbf.bin
26-
├── table2
27-
└── table3
21+
│ └── _indices/
22+
│ └── 85814508-ed9a-41f2-b939-2050bb7a0ed5-fts/
23+
│ └── index.idx
24+
├── table2.lance
25+
└── table3.lance
2826
```
2927

3028
This describes a Lance directory namespace with the namespace directory at `/my/dir1/`.
3129
It contains tables `table1`, `table2`, `table3` sitting at table directories
32-
`/my/dirs/table1`, `/my/dirs/table2`, `/my/dirs/table3` respectively.
30+
`/my/dirs/table1.lance`, `/my/dirs/table2.lance`, `/my/dirs/table3.lance` respectively.
3331

34-
## Directory Path
32+
## Configuration
3533

36-
There are 3 ways to specify a directory path:
34+
The Lance directory namespace accepts the following configuration properties:
35+
36+
| Property | Required | Description | Default | Example |
37+
|---------------|----------|-------------------------------------------------------------|---------------------------|---------------------------------|
38+
| `root` | No | The root directory of the namespace where tables are stored | Current working directory | `/my/dir`, `s3://bucket/prefix` |
39+
| `storage.*` | No | Storage-specific configuration options | | `storage.region=us-west-2` |
40+
41+
### Root Path
42+
43+
There are 3 ways to specify a root path:
3744

3845
1. **URI**: a URI that follows the [RFC 3986 specification](https://datatracker.ietf.org/doc/html/rfc3986), e.g. `s3://mu-bucket/prefix`.
3946
2. **Absolute POSIX storage path**: an absolute file path in a POSIX standard storage, e.g. `/my/dir`.
4047
3. **Relative POSIX storage path**: a relative file path in a POSIX standard storage, e.g. `my/dir2`, `./my/dir3`.
41-
The absolute path of the directory should be based on the current directory of the running process.
48+
The absolute path of the root should be derived from the current working directory.
49+
50+
### Storage Options
51+
52+
Properties with the `storage.` prefix are passed directly to the underlying OpenDAL storage system
53+
after removing the prefix. For example, `storage.region` becomes `region` when passed to the storage layer.
54+
Please visit [Apache OpenDAL](https://opendal.apache.org) for more details.
4255

4356
## Table Existence
4457

45-
A table exists in a Lance directory namespace if a table directory of the specific name exists.
46-
This is true even if the directory is empty or the contents in the directory does not follow the Lance table format spec.
47-
For such cases, an operation that lists all tables in the directory should show the specific table,
48-
and an operation that checks if a table exists should return true.
49-
However, an operation that loads the Lance table metadata should fail with error
50-
indicating the content in the folder is not compliant with the Lance table format spec.
58+
A table exists in a Lance directory namespace if a table directory of the specific name exists
59+
**and** contains a non-empty `_versions` subdirectory.
60+
61+
When checking if a specific table exists or deciding if a table should be listed,
62+
the operation must list objects with the `_versions/` prefix and checks if any objects exist.
63+
If the directory exists but there is no file in the directory, it should be treated as non-existent.

docs/src/spec/impls/rest/index.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@ for more advanced governance features around access control, auditing, lineage t
66
by connecting those metadata services or building a custom metadata server in a standardized way.
77
The REST server definition can be found in the [OpenAPI specification](https://editor-next.swagger.io/?url=https://raw.githubusercontent.com/lancedb/lance-namespace/refs/heads/main/docs/src/spec/rest.yaml).
88

9+
## Configuration
10+
11+
The Lance REST namespace accepts the following configuration properties:
12+
13+
| Property | Required | Description | Default | Example |
14+
|-------------|----------|------------------------------------------------------------------------|---------|-----------------------------------|
15+
| `uri` | Yes | The URI endpoint for the REST API | | `https://api.example.com/lance` |
16+
| `delimiter` | No | The delimiter used to parse object string identifiers in REST routes | `.` | `.`, `/`, `::`, `#` |
17+
| `headers.*` | No | Additional headers to send with every request | | `headers.Authorization=Bearer...` |
18+
19+
### Headers
20+
21+
Properties with the `headers.` prefix are passed as HTTP headers with every request to the REST server
22+
after removing the prefix. For example, `headers.Authorization` becomes the `Authorization` header.
23+
24+
Common header configurations include:
25+
- `headers.Authorization`: Authentication tokens (Bearer, Basic, etc.)
26+
- `headers.X-API-Key`: API key authentication
27+
- `headers.X-Request-ID`: Request tracking
28+
929
## REST Routes
1030

1131
The REST route for an operation typically follows the pattern of `POST /<version>/<object>/{id}/<action>`,
@@ -69,4 +89,4 @@ here are some criteria to consider:
6989
but it might not always support a specific implementation. This favors the adapter approach.
7090
3. **Security**: if you have security concerns about the adapter being a man-in-the-middle, you should choose an implementation
7191
4. **Performance**: after all, adapter adds one layer of indirection and is thus not the most performant solution.
72-
If you are performance sensitive, you should choose an implementation
92+
If you are performance sensitive, you should choose an implementation

docs/src/spec/operations/alter-transaction.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## Request Schema
1010

1111
```yaml
12-
--8<-- "src/spec/rest.yaml:2028:2045"
12+
--8<-- "src/spec/rest.yaml:2025:2042"
1313
```
1414
Supporting action schemas:
1515

@@ -28,22 +28,22 @@ Supporting action schemas:
2828
## Response Schema
2929

3030
```yaml
31-
--8<-- "src/spec/rest.yaml:2046:2057"
31+
--8<-- "src/spec/rest.yaml:2043:2054"
3232
```
3333

3434
## Related Components Schema
3535
### Set Status Action
3636

3737
```yaml
38-
--8<-- "src/spec/rest.yaml:1966:1971"
38+
--8<-- "src/spec/rest.yaml:1963:1968"
3939
```
4040
### Set Property Action
4141

4242
```yaml
43-
--8<-- "src/spec/rest.yaml:1972:1981"
43+
--8<-- "src/spec/rest.yaml:1969:1978"
4444
```
4545
### Unset Property Action
4646

4747
```yaml
48-
--8<-- "src/spec/rest.yaml:1994:2001"
48+
--8<-- "src/spec/rest.yaml:1991:1998"
4949
```

docs/src/spec/operations/count-table-rows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
## Request Schema
1010

1111
```yaml
12-
--8<-- "src/spec/rest.yaml:1362:1380"
12+
--8<-- "src/spec/rest.yaml:1359:1377"
1313
```
1414
## Response Schema
1515

1616
```yaml
17-
--8<-- "src/spec/rest.yaml:1381:1388"
17+
--8<-- "src/spec/rest.yaml:1378:1385"
1818
```

docs/src/spec/operations/create-table-index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
## Request Schema
1010

1111
```yaml
12-
--8<-- "src/spec/rest.yaml:1643:1708"
12+
--8<-- "src/spec/rest.yaml:1640:1705"
1313
```
1414
## Response Schema
1515

1616
```yaml
17-
--8<-- "src/spec/rest.yaml:1709:1726"
17+
--8<-- "src/spec/rest.yaml:1706:1723"
1818
```

docs/src/spec/operations/create-table.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
## Request Schema
1010

1111
```yaml
12-
--8<-- "src/spec/rest.yaml:1880:1895"
12+
--8<-- "src/spec/rest.yaml:1877:1894"
1313
```
1414
## Response Schema
1515

1616
```yaml
17-
--8<-- "src/spec/rest.yaml:1896:1921"
17+
--8<-- "src/spec/rest.yaml:1895:1918"
1818
```

docs/src/spec/operations/delete-from-table.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
## Request Schema
1010

1111
```yaml
12-
--8<-- "src/spec/rest.yaml:1515:1531"
12+
--8<-- "src/spec/rest.yaml:1512:1528"
1313
```
1414
## Response Schema
1515

1616
```yaml
17-
--8<-- "src/spec/rest.yaml:1532:1542"
17+
--8<-- "src/spec/rest.yaml:1529:1539"
1818
```

docs/src/spec/operations/deregister-table.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
## Request Schema
1010

1111
```yaml
12-
--8<-- "src/spec/rest.yaml:2089:2098"
12+
--8<-- "src/spec/rest.yaml:2086:2095"
1313
```
1414
## Response Schema
1515

1616
```yaml
17-
--8<-- "src/spec/rest.yaml:2099:2112"
17+
--8<-- "src/spec/rest.yaml:2096:2109"
1818
```

docs/src/spec/operations/describe-table-index-stats.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
## Request Schema
1010

1111
```yaml
12-
--8<-- "src/spec/rest.yaml:1776:1792"
12+
--8<-- "src/spec/rest.yaml:1773:1789"
1313
```
1414
## Response Schema
1515

1616
```yaml
17-
--8<-- "src/spec/rest.yaml:1793:1816"
17+
--8<-- "src/spec/rest.yaml:1790:1813"
1818
```

0 commit comments

Comments
 (0)