[ 
https://issues.apache.org/jira/browse/HIVE-14387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15402213#comment-15402213
 ] 

Marta Kuczora commented on HIVE-14387:
--------------------------------------

Found the following config parameter: 
hive.resultset.use.unique.column.names
Make column names unique in the result set by qualifying column names with 
table alias if needed. Table alias will be added to column names for queries of 
type "select *" or if query explicitly uses table alias "select r1.x..".
Default value: true

If this parameter is set to false, the result will contain only the column 
names without the table name prefix.

Example:
hive.resultset.use.unique.column.names=true
{noformat}
0: jdbc:hive2://> select * from car limit 1;
OK
+------------+-----------+------------+-----------+-----------+--+
| car.carid  | car.type  | car.color  | car.lnum  | car.year  |
+------------+-----------+------------+-----------+-----------+--+
| 1000       | Audi      | red        | AAA111    | 2009      |
+------------+-----------+------------+-----------+-----------+--+
1 row selected (0.084 seconds)
{noformat}

hive.resultset.use.unique.column.names=false
{noformat}
0: jdbc:hive2://> select * from car limit 1;
OK
+--------+-------+--------+---------+-------+--+
| carid  | type  | color  |  lnum   | year  |
+--------+-------+--------+---------+-------+--+
| 1000   | Audi  | red    | AAA111  | 2009  |
+--------+-------+--------+---------+-------+--+
1 row selected (0.084 seconds)
{noformat}

[~vihangk1], would this parameter be a suitable option?

> Add an option to skip the table names for the column headers
> ------------------------------------------------------------
>
>                 Key: HIVE-14387
>                 URL: https://issues.apache.org/jira/browse/HIVE-14387
>             Project: Hive
>          Issue Type: Improvement
>          Components: Beeline
>            Reporter: Vihang Karajgaonkar
>            Assignee: Marta Kuczora
>            Priority: Minor
>
> It would be good to have an option where the beeline output could skip 
> reporting the <table_name>.<column_name> in the headers.
> Eg:
> {noformat}
> 0: jdbc:hive2://:> select * from sample_07 limit 1; 
> --------------------------------------------------------------------------------------------------
> sample_07.code        sample_07.description   sample_07.total_emp     
> sample_07.salary
> --------------------------------------------------------------------------------------------------
> 00-0000       Operations      123     12345
> --------------------------------------------------------------------------------------------------
> {noformat}
> b) After the option is set:
> {noformat}
> 0: jdbc:hive2://:> select * from sample_07 limit 1; 
> ---------------------------------------------------
> code   description    total_emp        salary
> ---------------------------------------------------
> 00-0000       Operations      123     12345
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to