Skip to content

fix(index): normalize CREATE INDEX WITH option keys to lower case - #260

Closed
jackylee-ch wants to merge 1 commit into
lance-format:mainfrom
jackylee-ch:fix/index-with-keys-case-insensitive
Closed

jackylee-ch wants to merge 1 commit into
lance-format:mainfrom
jackylee-ch:fix/index-with-keys-case-insensitive

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

Lance matches index parameter names case-sensitively (serde snake_case),
while DuckDB treats WITH (...) option keys case-insensitively. A mis-cased
key such as Num_Partitions or Metric_Type was passed through verbatim and
silently dropped by Lance, so the index was built with default settings
(e.g. 256 partitions / L2) instead of what was requested — with no error.

Normalize passthrough option keys to lower case in both WITH-clause parsers
(the parser-extension string path and the DuckDB options path), matching
DuckDB's own case-insensitive option handling. test/sql/index_ddl.test
covers it via a mis-cased key whose normalized form surfaces Lance's own
validation of the option value.

Lance matches index parameter names case-sensitively (serde snake_case),
but DuckDB treats WITH option keys case-insensitively. A mis-cased key
such as `Num_Partitions` or `Metric_Type` was passed through verbatim and
silently dropped by Lance, so the index was built with default settings
instead of the requested ones, with no error.

Normalize passthrough option keys to lower case in both WITH-clause
parsers (the SQL-string parser-extension path and the DuckDB options
path), matching DuckDB's case-insensitive option handling.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

Normalizing option keys at the SQL-to-JSON boundary fixes the silent fallback to default index settings and matches DuckDB’s case-insensitive option handling. Option values and raw params JSON retain their existing behavior, and the tokenizer regression correctly distinguishes an ignored setting from Lance validation.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 3, 2026
@jackylee-ch jackylee-ch closed this Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant