Skip to content

feat(vector): support VECTOR as a non-key value column in Parquet-backed primary-key tables. - #275

Open
ChaomingZhangCN wants to merge 1 commit into
apache:mainfrom
ChaomingZhangCN:codex/vector-pk-tables
Open

feat(vector): support VECTOR as a non-key value column in Parquet-backed primary-key tables.#275
ChaomingZhangCN wants to merge 1 commit into
apache:mainfrom
ChaomingZhangCN:codex/vector-pk-tables

Conversation

@ChaomingZhangCN

@ChaomingZhangCN ChaomingZhangCN commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: #197

Support VECTOR as a non-key value column in Parquet-backed primary-key tables.

This PR is scoped to PK tables:

  • It does not add VECTOR support for data-evolution tables.
  • It does not add or change schema-evolution APIs; schema evolution remains a separate capability.
  • VECTOR remains unsupported as a primary, partition, bucket, sequence, or sequence-group ordering field.

The implementation adds FixedSizeList handling across PK writes, spill serialization,
merge/compaction, equality checks, and Arrow read-back.

Tests

  • git diff --check
  • CMake configuration completed successfully.
  • Focused schema-validation and PK VECTOR write/read/compaction tests are included.

The focused build and test execution is still running locally because Arrow and its
dependencies must first be built from source.

API and Format

No public API or on-disk format change.

Documentation

Updated the VECTOR type documentation to state support for PK-table value columns and
the continued restriction for data-evolution tables.

Generative AI tooling

Generated-by: Codex (GPT-5)

Comment thread src/paimon/core/io/row_to_arrow_array_converter.h Outdated
Comment thread src/paimon/core/schema/schema_validation_test.cpp
if (file_format != "parquet") {
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like the current PR is intended to support merge functions for all types. Please update the issue description accordingly, and also add tests for listagg and spill.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, could you add a test for a PK table with a nested type containing a vector field, to verify the recursive row/column conversion for vectors?

@ChaomingZhangCN ChaomingZhangCN changed the title feat(vector): support primary-key tables feat(vector): support VECTOR as a non-key value column in Parquet-backed primary-key tables. Sep 2, 2026
sort_options, &exec_context));
// Arrow's StructArray sorting path may inspect value columns outside the sort keys. Restrict
// the batch to the requested fields so non-sortable values, such as VECTOR, are never compared.
std::shared_ptr<arrow::RecordBatch> sort_batch =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I’d like to better understand what issues inspect value columns can cause here. Does it lead to incorrect sorting, crashes, or explicit errors? Also, is this considered a bug in Arrow, and is there any ongoing fix for it?


struct PrimaryKeyVectorRow {
int64_t primary_key;
std::optional<std::array<float, 3>> embedding;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please try to avoid using this kind of struct unless the entire test uses a fixed schema throughout. Otherwise, please use simple Arrow JSON to initialize the input and expected Arrow arrays, as it is more straightforward and easier to read.

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