lance-format / lance-format/lance

Don't use dictionary encoding if _true_ cardinality ends up being too high

Open
#4,071 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-encoding enhancement
Dominant language
Rust
Stars
7.1k
Forks
852
Avg merge
3d 18h
Merged PRs (30d)
272

Description

We use hyper log log to decide if we should attempt dictionary encoding or not. However, HLL is just an estimate. In some cases it might be wildly incorrect.

In these cases, as we perform the dictionary encoding, we will discover the true cardinality. Currently, we just proceed with dictionary encoding even if the true cardinality is high. We should instead abandon the dictionary (discard it as wasted effort) and go back to regular encoding.

This can be specific to 2.1+.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the HyperLogLog cardinality check and dictionary-encoding path, then trace where true cardinality becomes available during encoding. Done means a high true cardinality discards the dictionary and falls back to regular encoding for version 2.1+.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data-engineering
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.