infiniflow / infiniflow/infinity
[Bug]: Thrift SDK crashes selecting an array-of-embedding column (AttributeError: 'NoneType' has no attribute 'dimension')
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 4.7k
- Forks
- 445
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 7
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Version or Commit ID
main @ 4954148 (current main as of 2026-09-08)
Other environment information
Actual behavior and How to reproduce it
Selecting from a table with an array-of-embedding column (e.g. "array,vector,4,float") over the thrift SDK crashes the client result parser:
AttributeError: 'NoneType' object has no attribute 'dimension'
In parse_single_array_bytes (python/infinity_sdk/infinity/remote_thrift/types.py), the Embedding arm reads the embedding metadata from the wrong DataType:
embedding_dimension = column_data_type.physical_type.embedding_type.dimension
match column_data_type.physical_type.embedding_type.element_type:
column_data_type is the ARRAY type, so its physical_type union carries array_type and embedding_type is None. The embedding info lives on element_data_type (the array's element type), which the function already extracts two lines above.
The server side supports this fine: InfinityThriftService::HandleArrayTypeRecursively serializes an array-of-embedding as i32 element count followed by count * dimension * element-size raw bytes, and create-table accepts array,vector,N,float (the element DataType is converted recursively). Only the client parse path is broken.
Repro (serverless, feeds the exact wire bytes the server produces):
from infinity.remote_thrift.types import parse_single_array_bytes
# col = DataType(logic_type=Array, array_type.element_data_type =
# DataType(logic_type=Embedding, embedding_type=(float32, dim 4)))
buf = struct.pack('<i', 2) + struct.pack('<8f', 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0)
parse_single_array_bytes(col, buf, 0) # AttributeError
Expected behavior
The parser reads the embedding dimension/element type from element_data_type (where the union actually holds embedding_type) and returns [[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]] for the bytes above.
Additional information
Fix: two-line change to read embedding info from element_data_type instead of column_data_type, plus a regression test round-tripping an array,vector,4,float column (insert + select). PR coming.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in python/infinity_sdk/infinity/remote_thrift/types.py at parse_single_array_bytes and inspect how element_data_type is extracted for array values. Reproduce the failure with the serverless byte buffer from the issue, then add a regression test round-tripping an array,vector,4,float column through insert and select. Done means the parser returns two four-element arrays without raising AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100