chaoyli opened a new issue #5142:
URL: https://github.com/apache/incubator-doris/issues/5142
Array is used to store data like user labels.
made up of (offset, element), element can be an Array.
[1, 2, 3], [4, 5, 6]
Doris have implement array nest type. But it's not extensible.
```
1. It store NULL with offset, which only be feasible to Array, but not to
Struct.
Struct is made of {element 1, element2}, but not has implicit offset
column.
Array should store null as a new column, not attaches to offset column.
2. It stores offset with absolute ordinal, so every offset ColumnWriter will
have to
callback ArrayColumnWriter to record the position. The logic is so trick
to understand.
3. When read the ArrayColumn, it have to seek to next position to get the
right end offset.
```
So I think it to better to distinguish the memory layout and disk layout.
```
[[1, 2], [3, 4]], [[5, 6, 7], null, [8]], [[9, 10]]
* Offsets buffer (int32)
| Bytes 0-3 | Bytes 4-7 | Bytes 8-11 | Bytes 12-15 |
|------------|------------|------------|-------------|
| 0 | 2 | 5 | 6 |
* Values array (`List<Int8>`)
| Byte 0 (validity bitmap) | Bytes 1-63 |
|--------------------------|-------------|
| 00110111 | 0 (padding) |
* Offsets buffer (int32)
| Bytes 0-27 |
|----------------------|
| 0, 2, 4, 7, 7, 8, 10 |
* Elements array (Int8):
| Bytes 0-9 |
|-------------------------------|
| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]