[
https://issues.apache.org/jira/browse/HIVE-7390?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ferdinand Xu updated HIVE-7390:
-------------------------------
Release Note:
--outputformat=[table/vertical/csv/tsv/dsv]
Format mode for result display. Default is table.
Usage: beeline --outputformat=tsv
--delimiterForDSV=DELIMITER
specify the delimiter for delimiter-separated values output format (default: |)
Usage: beeline --outputformat=dsv --delimiterForDSV=,
beeline dsv and delimiterForDSV examples are as followings:
% bin/beeline
Hive version 0.11.0-SNAPSHOT by Apache
beeline> !connect jdbc:hive2://localhost:10000 scott tiger
org.apache.hive.jdbc.HiveDriver
!connect jdbc:hive2://localhost:10000 scott tiger
org.apache.hive.jdbc.HiveDriver
Connecting to jdbc:hive2://localhost:10000
Connected to: Hive (version 0.14.0-SNAPSHOT)
Driver: Hive (version 0.14.0-SNAPSHOT)
Transaction isolation: TRANSACTION_REPEATABLE_READ
HiveServer2 Clients – dsv Example
0: jdbc:hive2://localhost:10000> create table csv_table(id int, name string,
info string) row format delimited fields terminated by '\t';
No rows affected (0.121 seconds)
0: jdbc:hive2://localhost:10000> load data local inpath '/root/names' overwrite
into table csv_table;
No rows affected (0.245 seconds)
0: jdbc:hive2://localhost:10000> select * from csv_table;
+---------------+-----------------+-----------------+--+
| csv_table.id | csv_table.name | csv_table.info |
+---------------+-----------------+-----------------+--+
| 19630001 | "john" | lennon |
| 19630002 | peter,paul | mccartney |
| 19630003 | george | harrison |
| 19630004 | ringo | starr |
+---------------+-----------------+-----------------+--+
4 rows selected (0.09 seconds)
0: jdbc:hive2://localhost:10000> !outformat csv
Unknown command: outformat csv
0: jdbc:hive2://localhost:10000> !outputformat csv
0: jdbc:hive2://localhost:10000> select * from csv_table;
csv_table.id,csv_table.name,csv_table.info
19630001,"""john""",lennon
19630002,"peter,paul",mccartney
19630003,george,harrison
19630004,ringo,starr
4 rows selected (0.105 seconds)
0: jdbc:hive2://localhost:10000> !outputformat dsv
0: jdbc:hive2://localhost:10000> select * from csv_table;
csv_table.id|csv_table.name|csv_table.info
19630001|"""john"""|lennon
19630002|peter,paul|mccartney
19630003|george|harrison
19630004|ringo|starr
4 rows selected (0.123 seconds)
0: jdbc:hive2://localhost:10000> !set delimiterForDSV ',';
0: jdbc:hive2://localhost:10000> select * from csv_table;
csv_table.id'csv_table.name'csv_table.info
19630001'"""john"""'lennon
19630002'peter,paul'mccartney
19630003'george'harrison
19630004'ringo'starr
4 rows selected (0.11 seconds)
> Make quote character optional and configurable in BeeLine CSV/TSV output
> ------------------------------------------------------------------------
>
> Key: HIVE-7390
> URL: https://issues.apache.org/jira/browse/HIVE-7390
> Project: Hive
> Issue Type: New Feature
> Components: Clients
> Affects Versions: 0.13.1
> Reporter: Jim Halfpenny
> Assignee: Ferdinand Xu
> Labels: TODOC14
> Fix For: 0.14.0
>
> Attachments: HIVE-7390.1.patch, HIVE-7390.2.patch, HIVE-7390.3.patch,
> HIVE-7390.4.patch, HIVE-7390.5.patch, HIVE-7390.6.patch, HIVE-7390.7.patch,
> HIVE-7390.8.patch, HIVE-7390.9.patch, HIVE-7390.patch
>
>
> Currently when either the CSV or TSV output formats are used in beeline each
> column is wrapped in single quotes. Quote wrapping of columns should be
> optional and the user should be able to choose the character used to wrap the
> columns.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)