Details
-
Improvement
-
Status: Patch Available
-
Major
-
Resolution: Unresolved
-
3.1.0
-
None
Description
In Hive 1.2.1 and 2.0 while displaying columns for a table, it used to return in same order as it was created. for example
create table col_order_test(server_name string, task_name string, partition_name string, start_time string, end_time string, table_owner string, table_name string) stored as orc; show columns in col_order_test; +-----------------+--+ | field | +-----------------+--+ | server_name | | task_name | | partition_name | | start_time | | end_time | | table_owner | | table_name | +-----------------+--+
For Hive 3 columns are returned in sorted order for the same query, below is output.
create table col_order_test(server_name string, task_name string, partition_name string, start_time string, end_time string, table_owner string, table_name string) stored as orc; show columns in col_order_test; +-----------------+ | field | +-----------------+ | end_time | | partition_name | | server_name | | start_time | | table_name | | table_owner | | task_name | +-----------------+
Above behavior looks to be changed with the introduction of search column feature as part of Jira HIVE-18373
This behavior change can cause an existing process to fail in a few environments, for example, code to generate the INSERT OVERWRITE in a different manner, which may result in query failure.
I would like to request a community if we can improve the Jira HIVE-18373 by returning column order same as it was created if the search pattern provided by the user is null.
Attaching patch with the change.
Attachments
Attachments
Issue Links
- links to