I am trying beeline cli to query hive table and store output result as variable. Using beeline command:
beeline -u connection_string -n user_name -w password_file \
-e "select count(*) from db.table_name"
Using this command, I getting the current output result as:
+---------------+--+
| record_count |
+---------------+--+
| 80785 |
+---------------+--+
While I need result as: Record count:80785
Another command I am using is:
beeline -u connection_string -n user_name -w password_file \
-e "select * from db.table_name;” > result.csv
Which again displaying result in tabular format data separated by |
.
Basically beeline, by default, is returning the header( table_name.column_name
) then the data in tabular format. Whereas, I want to eliminate this and get results like hive CLI.