Skip to content
Open
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
51 changes: 51 additions & 0 deletions chunk-key-encodings/prefix/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# `prefix` Chunk Key Encoding

## Summary

This specification defines a chunk key encoding that prepends a constant string to the chunk keys produced by another chunk key encoding.

## Metadata

| field | type | required |
| - | - | - |
| `name` | Literal "prefix" | yes |
| `configuration` | [Configuration](#configuration) | yes |

## Configuration

| field | type | required |
| - | - | - |
| [`prefix`](#prefix) | string | yes |
| [`base_encoding`](#base-encoding) | chunk key encoding | yes |

### `prefix`

The `prefix` field is a string that is prepended to a chunk key generated by the chunk key encoding declared in the `base_encoding` field.

The following constraints apply to the `prefix` field:
- `prefix` MUST NOT begin with `/`.
- `prefix` MUST NOT contain the substrings `..`, `\`, `\0`, or `//`.
- `prefix` MUST NOT contain the string `zarr.json`.
- `prefix` MUST NOT be the empty string.

### `base_encoding`

The `base_encoding` field is the metadata for another chunk key encoding. The output of this chunk key encoding is the base string to which the string declared by `prefix` is prepended.

## Examples

### x/

This configuration prepends `x/` to the key generated by the `v2` chunk key encoding with the default configuration (`separator` implicitly set to `.`).

```json
{
"name": "prefix",
"configuration": {
"prefix": "x/",
"base_encoding": "v2"
}
}
```

For a 3-dimensional array, the chunk at (0,0,0) would have the key `x/0.0.0`.