feat(blob): support reading map blob values - #278
Conversation
|
@lxy-9602 pls take time to review |
|
|
||
| Result<std::shared_ptr<arrow::Array>> BlobFileBatchReader::BuildMapBlobArray( | ||
| int32_t rows_to_read) const { | ||
| const auto& struct_type = static_cast<const arrow::StructType&>(*target_type_); |
There was a problem hiding this comment.
This function seems too long. Please break it down into smaller, more fine-grained pieces.
There was a problem hiding this comment.
Refactored in 00da44a. Payload parsing/validation, key appends, and value appends are now split into ReadMapBlobPayload, AppendMapBlobKeys, and AppendMapBlobValues; BuildMapBlobArray only coordinates rows and builders.
| ASSERT_OK_AND_ASSIGN(int64_t written, | ||
| output_stream->Write(file_bytes.data(), file_bytes.size())); | ||
| ASSERT_EQ(file_bytes.size(), written); | ||
| ASSERT_OK(output_stream->Close()); |
There was a problem hiding this comment.
Consider use file_system->WriteFile
There was a problem hiding this comment.
Updated all added golden/corruption fixture writes to use FileSystem::WriteFile in 00da44a.
| for (int32_t entry = 0; entry < entry_count; ++entry) { | ||
| const auto key_length = static_cast<int32_t>(key_lengths[entry]); | ||
| std::vector<uint8_t> key_bytes(key_length); | ||
| PAIMON_RETURN_NOT_OK(ReadBlobContentAt(key_offset, key_length, key_bytes.data())); |
There was a problem hiding this comment.
I’m not sure how large key_bytes can get. If it can be large, it would be better to allocate it from the pool, for example via Bytes.
There was a problem hiding this comment.
Updated in 00da44a. Key buffers now use pool-backed Bytes; inline value buffers use the same allocation path.
|
Thank you very much for adding support for |
|
Thanks for your work on this! Is there any plan to support reading and writing |
| {"TIME(0)", arrow::time32(arrow::TimeUnit::MILLI)}, | ||
| {"TIME(3)", arrow::time32(arrow::TimeUnit::MILLI)}, | ||
| {"TIME(9)", arrow::time32(arrow::TimeUnit::MILLI)}, | ||
| {"TIME(3) WITHOUT TIME ZONE", arrow::time32(arrow::TimeUnit::MILLI)}, |
There was a problem hiding this comment.
Please also add ut for "TIME(6) WITHOUT TIME ZONE"...
There was a problem hiding this comment.
Please also add ut for "TIME(6) WITHOUT TIME ZONE"...
Removed TIME support in this PR.
Purpose
Linked issue: #283
Support reading Java-compatible
MAP<K, BLOB>payloads from blob files through the real Table API and data-evolution paths.MAP<K, BLOB>schemas from table JSON while continuing to reject BLOBs in other nested positions.MAP<K, BLOB>tables as read-only in C++: reject C++ table creation,FileStoreWrite::Create, and append compaction until writer support is implemented.MAP<K, BLOB>placeholders across multiple sequence layers in both inline and descriptor modes.paimon.map.selected-keysfor Map Blob reads because filtering can remove the internal data-evolution fallback placeholder.TIMEkeys andARRAY<BLOB>are intentionally outside this PR and should be handled separately with their end-to-end type and format support.Tests
ninja -C build-release paimon-blob-format-testbuild-release/release/paimon-blob-format-test --gtest_filter='BlobFileBatchReaderTest.*:BlobAsDescriptor/BlobFileBatchReaderTest.*'(17 tests passed)NestedProjectionUtilsTest.GetMapSelectedKeysRejectsMapBlobtest (passed)-Werror -Wallcpplint,codespell, andgit diff --checkAPI and Format
No public API under
include/and no storage format changes. This adds read compatibility for the existing Paimon JavaMAP<X, BLOB>payload version 1. C++ writer support is unchanged; table creation, regular writes, and append compaction are explicitly rejected.Arrow Map requires non-null keys, so Java Map Blob payloads containing null keys are rejected during decoding.
Documentation
No documentation changes.
Generative AI tooling
Generated-by: OpenAI Codex (GPT-5)