Skip to content

[eslib] Do not require build-time es-index options when reading persisted indexes - #9969

Merged
JingsongLi merged 1 commit into
apache:masterfrom
thswlsqls:fix/eslib-read-persisted-index-without-build-options
Sep 19, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
thswlsqls:fix/eslib-read-persisted-index-without-build-options

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Purpose

fix #9968

  • Following the README, an ARRAY<FLOAT> es-index whose dimension is passed only through sys.create_global_index(... options => ...) fails every vector_search, full_text_search and companion-column WHERE query with "Vector field 'embedding' requires a positive dimension": ESIndexGlobalIndexer parses ESIndexOptions in its constructor, while the core read paths create it from the table options only.
  • Defer the parse to createWriter, so invalid build options still fail there with the same message instead of in the constructor. ESIndexGlobalIndexReader uses the persisted field configuration and requires the current options only for legacy offset-only metadata.
  • Resolve the configured vector metric from the options directly so metric() works before a reader is registered.

Tests

  • Added ESIndexVectorMetricTest#readerDoesNotRequireCurrentOptionsToDescribeBuild, #writerStillRejectsOptionsThatCannotDescribeBuild, #legacyMetadataStillRequiresCurrentOptions; all three fail on master in the ESIndexGlobalIndexer constructor.
  • mvn -Ppaimon-eslib -pl paimon-eslib clean install (JDK 11, checkstyle and spotless included): BUILD SUCCESS, 0 failures; ESIndexVectorMetricTest 7/7.

…sted indexes

ESIndexGlobalIndexer parsed ESIndexOptions eagerly in its constructor, so an
ARRAY<FLOAT> es-index whose dimension was only passed to the build procedure
could not be read: the core read paths create the indexer from the table
options alone and failed with "requires a positive dimension" before the
reader could use the field configuration persisted in the index metadata.

Defer the parse failure to createWriter, which re-parses the options and keeps
the same fail-fast message for builds. The reader now accepts a null fallback
and only requires the current options for legacy offset-only metadata that
does not persist the field configuration. The configured vector metric is
resolved from the options directly so metric() stays available before a
reader is registered.

Generated-by: Claude Code
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit 93185cd into apache:master Sep 19, 2026
6 checks passed
@thswlsqls
thswlsqls deleted the fix/eslib-read-persisted-index-without-build-options branch September 21, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] es-index built with procedure-only dimension option cannot be read

2 participants