Uh oh!
There was an error while loading. Please reload this page.
[opt](parquet) Support hive struct schema change - #32438
Conversation
doris-robot
commented
Mar 19, 2024
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
clang-tidy review says "All clean, LGTM! 👍" |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
clang-tidy review says "All clean, LGTM! 👍" |
1e51e30 to
a5cdbc5Compareclang-tidy review says "All clean, LGTM! 👍" |
a5cdbc5 to
ad3d61bCompareclang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
AshinGau
commented
Mar 21, 2024
LGTM |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
zy-kkk
commented
Mar 21, 2024
run buildall |
239de18 to
0f8ee1bCompareclang-tidy review says "All clean, LGTM! 👍" |
doris-robot
commented
Mar 21, 2024
TeamCity be ut coverage result: |
zy-kkk
commented
Mar 21, 2024
run buildall |
doris-robot
commented
Mar 21, 2024
TeamCity be ut coverage result: |
impl insert null when struct's field is missing check field of sturct must be nullable fix get_rep_level and get_rep_level of StructColumnReader
0f8ee1b to
04e3a36Comparesuxiaogang223
commented
Mar 21, 2024
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
suxiaogang223
commented
Mar 21, 2024
run buildall |
doris-robot
commented
Mar 21, 2024
TeamCity be ut coverage result: |
Followup: #31128 This optimization allows doris to correctly read struct type data after changing the schema from hive. ## Changing struct schema in hive: ```sql hive> create table struct_test(id int,sf struct<f1: int, f2: string>) stored as parquet; hive> insert into struct_test values > (1, named_struct('f1', 1, 'f2', 's1')), > (2, named_struct('f1', 2, 'f2', 's2')), > (3, named_struct('f1', 3, 'f2', 's3')); hive> alter table struct_test change sf sf struct<f1:int, f3:string>; hive> select * from struct_test; OK 1 {"f1":1,"f3":null} 2 {"f1":2,"f3":null} 3 {"f1":3,"f3":null} Time taken: 5.298 seconds, Fetched: 3 row(s) ``` The previous result of doris was: ```sql mysql> select * from struct_test; +------+-----------------------+ | id | sf | +------+-----------------------+ | 1 | {"f1": 1, "f3": "s1"} | | 2 | {"f1": 2, "f3": "s2"} | | 3 | {"f1": 3, "f3": "s3"} | +------+-----------------------+ ``` Now the result is same as hive: ```sql mysql> select * from struct_test; +------+-----------------------+ | id | sf | +------+-----------------------+ | 1 | {"f1": 1, "f3": null} | | 2 | {"f1": 2, "f3": null} | | 3 | {"f1": 3, "f3": null} | +------+-----------------------+ ```
Followup: apache#31128 This optimization allows doris to correctly read struct type data after changing the schema from hive. ## Changing struct schema in hive: ```sql hive> create table struct_test(id int,sf struct<f1: int, f2: string>) stored as parquet; hive> insert into struct_test values > (1, named_struct('f1', 1, 'f2', 's1')), > (2, named_struct('f1', 2, 'f2', 's2')), > (3, named_struct('f1', 3, 'f2', 's3')); hive> alter table struct_test change sf sf struct<f1:int, f3:string>; hive> select * from struct_test; OK 1 {"f1":1,"f3":null} 2 {"f1":2,"f3":null} 3 {"f1":3,"f3":null} Time taken: 5.298 seconds, Fetched: 3 row(s) ``` The previous result of doris was: ```sql mysql> select * from struct_test; +------+-----------------------+ | id | sf | +------+-----------------------+ | 1 | {"f1": 1, "f3": "s1"} | | 2 | {"f1": 2, "f3": "s2"} | | 3 | {"f1": 3, "f3": "s3"} | +------+-----------------------+ ``` Now the result is same as hive: ```sql mysql> select * from struct_test; +------+-----------------------+ | id | sf | +------+-----------------------+ | 1 | {"f1": 1, "f3": null} | | 2 | {"f1": 2, "f3": null} | | 3 | {"f1": 3, "f3": null} | +------+-----------------------+ ```
Proposed changes
Followup: #31128
This optimization allows doris to correctly read struct type data after changing the schema from hive.
Changing struct schema in hive:
The previous result of doris was:
Now the result is same as hive: