Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Beeline select query

avatar

I am trying to switch to Beeline from hive, but I have one issue.

Hive :

Query : select * from table;

Output : The output is in readable format i.e we can scroll down to see complete data on my screen(terminal).

Beeline : Query : select * from table;

Output : The output is not in readable format i.e we cannot scroll down to see complete data. All columns are mixed up.

Work Around : I tried setting --maxWidth=100 it worked for one table with 10 columns. But still the output is not properly readable. I have to change the value of maxWidth for different tables as different tables have different number of columns.

So, is there any way to set some default value so that the data becomes understandable using beeline?

1 ACCEPTED SOLUTION

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
4 REPLIES 4

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar

@Kuldeep Kulkarni thanks it worked for me.

avatar
Master Guru

Thank you @Pooja Chawda

avatar
Rising Star

Due to HIVE_8615, it is advised to start using csv2/tsv2 for Beeline output formatting as csv/tsv are deprecated as of Hive 0.14.

More details can be on the Apache Hiveserver2 Client wiki:

"Separated-Value Output Formats Starting with Hive 0.14, there are improved SV output formats available, namely DSV, CSV2 and TSV2. These conform better to standard CSV convention, which adds quotes around a cell value only if it contains special characters (such as the delimiter character or a quote character) or spans multiple lines. These three formats differ only with the delimiter between cells, which is comma for CSV2, tab for TSV2, and configurable for DSV (delimiterForDSV property).

CSV and TSV output formats are maintained for backward compatibility, but beware as they add additional single-quote characters around all cell values contrary to this convention."