Skip to content

[common] Preserve empty scored results during serialization - #8924

Merged
JingsongLi merged 1 commit into
apache:masterfrom
QuakeWang:fix-empty-scored-serde
Jul 30, 2026
Merged

[common] Preserve empty scored results during serialization#8924
JingsongLi merged 1 commit into
apache:masterfrom
QuakeWang:fix-empty-scored-serde

Conversation

@QuakeWang

Copy link
Copy Markdown
Member

Purpose

GlobalIndexResultSerializer inferred the result type from the score count. Empty scored and unscored results both have zero scores, so round trips and copies lost the ScoredGlobalIndexResult type.

Introduce serialization version 2 with an explicit result kind, retain version 1 read compatibility, and add regression coverage for empty scored results and legacy payloads.

Tests

  • GlobalIndexSerDeUtilsTest
  • SparkDataEvolutionVectorReadTest
  • FlinkDataEvolutionVectorReadTest

GlobalIndexResultSerializer inferred the result type from the score count, so empty scored results were deserialized as unscored and failed scored-result callers.

Add an explicit result kind in serialization version 2, retain version 1 read compatibility, and cover empty scored round trips and legacy payloads.

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit 4926d60 into apache:master Jul 30, 2026
13 checks passed
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.

2 participants