-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature](hive)Support reading renamed Parquet Hive and Orc Hive tabl…
…es. (#38432) (#38809) bp #38432 ## Proposed changes Add `hive_parquet_use_column_names` and `hive_orc_use_column_names` session variables to read the table after rename column in `Hive`. These two session variables are referenced from `parquet_use_column_names` and `orc_use_column_names` of `Trino` hive connector. By default, these two session variables are true. When they are set to false, reading orc/parquet will access the columns according to the ordinal position in the Hive table definition. For example: ```mysql in Hive : hive> create table tmp (a int , b string) stored as parquet; hive> insert into table tmp values(1,"2"); hive> alter table tmp change column a new_a int; hive> insert into table tmp values(2,"4"); in Doris : mysql> set hive_parquet_use_column_names=true; Query OK, 0 rows affected (0.00 sec) mysql> select * from tmp; +-------+------+ | new_a | b | +-------+------+ | NULL | 2 | | 2 | 4 | +-------+------+ 2 rows in set (0.02 sec) mysql> set hive_parquet_use_column_names=false; Query OK, 0 rows affected (0.00 sec) mysql> select * from tmp; +-------+------+ | new_a | b | +-------+------+ | 1 | 2 | | 2 | 4 | +-------+------+ 2 rows in set (0.02 sec) ``` You can use `set parquet.column.index.access/orc.force.positional.evolution = true/false` in hive 3 to control the results of reading the table like these two session variables. However, for the rename struct inside column parquet table, the effects of hive and doris are different.
- Loading branch information
Showing
20 changed files
with
803 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
29 changes: 29 additions & 0 deletions
29
docker/thirdparties/docker-compose/hive/scripts/create_preinstalled_scripts/run64.hql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use default; | ||
|
||
create table simulation_hive1_orc( | ||
`a` boolean, | ||
`b` int, | ||
`c` string | ||
)stored as orc | ||
LOCATION '/user/doris/preinstalled_data/orc_table/simulation_hive1_orc'; | ||
msck repair table simulation_hive1_orc; | ||
|
||
create table test_hive_rename_column_parquet( | ||
`new_a` boolean, | ||
`new_b` int, | ||
`c` string, | ||
`new_d` int, | ||
`f` string | ||
)stored as parquet | ||
LOCATION '/user/doris/preinstalled_data/parquet_table/test_hive_rename_column_parquet'; | ||
msck repair table test_hive_rename_column_parquet; | ||
|
||
create table test_hive_rename_column_orc( | ||
`new_a` boolean, | ||
`new_b` int, | ||
`c` string, | ||
`new_d` int, | ||
`f` string | ||
)stored as orc | ||
LOCATION '/user/doris/preinstalled_data/orc_table/test_hive_rename_column_orc'; | ||
msck repair table test_hive_rename_column_orc; |
Binary file added
BIN
+408 Bytes
...ies/docker-compose/hive/scripts/preinstalled_data/orc_table/simulation_hive1_orc/000000_0
Binary file not shown.
Binary file added
BIN
+405 Bytes
...ker-compose/hive/scripts/preinstalled_data/orc_table/test_hive_rename_column_orc/000000_0
Binary file not shown.
Binary file added
BIN
+396 Bytes
...pose/hive/scripts/preinstalled_data/orc_table/test_hive_rename_column_orc/000000_0_copy_1
Binary file not shown.
Binary file added
BIN
+554 Bytes
...pose/hive/scripts/preinstalled_data/orc_table/test_hive_rename_column_orc/000000_0_copy_2
Binary file not shown.
Binary file added
BIN
+592 Bytes
...pose/hive/scripts/preinstalled_data/orc_table/test_hive_rename_column_orc/000000_0_copy_3
Binary file not shown.
Binary file added
BIN
+538 Bytes
...ose/hive/scripts/preinstalled_data/parquet_table/test_hive_rename_column_parquet/000000_0
Binary file not shown.
Binary file added
BIN
+543 Bytes
...e/scripts/preinstalled_data/parquet_table/test_hive_rename_column_parquet/000000_0_copy_1
Binary file not shown.
Binary file added
BIN
+787 Bytes
...e/scripts/preinstalled_data/parquet_table/test_hive_rename_column_parquet/000000_0_copy_2
Binary file not shown.
Binary file added
BIN
+801 Bytes
...e/scripts/preinstalled_data/parquet_table/test_hive_rename_column_parquet/000000_0_copy_3
Binary file not shown.
This file contains 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
This file contains 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
Oops, something went wrong.