branch-3.1: [fix](variant)fix top-array data into variant column #54396#54867
Merged
morrySnow merged 3 commits intoapache:branch-3.1from Aug 19, 2025
Merged
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
1 similar comment
Contributor
Author
|
run buildall |
added 2 commits
August 16, 2025 19:53
This pr mainly solves the problem when we insert top-level nested array
data into variant columnIssue Number:
like :
```
mysql> insert into sv1 values (1, '[{"a": 1, "c": 1.1}, {"b": "1"}]');
we maintain the association information between Nested in array , in this case , we will keep same offset at a,b,c ,
mysql> select * from sv1;
+------+----------------------------------------------+
| k | v |
+------+----------------------------------------------+
| 1 | {"a":[1,null],"b":[null,"1"],"c":[1.1,null]} |
+------+----------------------------------------------+
```
but in top array we just do flatten array not fill the null value to
maintain the association information between Nested in array
like:
```
mysql> insert into sv1 values (16, '[{"a": 1, "b": 1}, {"b": 2}, {"b": 3}]');
Query OK, 1 row affected (0.15 sec)
{'label':'label_4b3ede8b449a4d9a_b55fdeebe13b741c', 'status':'VISIBLE', 'txnId':'6031'}
mysql> select v from sv1 where k=16;
+-----------------------+
| v |
+-----------------------+
| {"a":[1],"b":[1,2,3]} |
+-----------------------+
1 row in set (0.19 sec)
```
d0160c9 to
fe9dd57
Compare
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 32753 ms |
TPC-DS: Total hot run time: 192066 ms |
ClickBench: Total hot run time: 28.25 s |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 32727 ms |
TPC-DS: Total hot run time: 192591 ms |
ClickBench: Total hot run time: 28.24 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
morrySnow
approved these changes
Aug 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
picked from #54396