Reply
Explorer
Posts: 13
Registered: ‎07-26-2016
Accepted Solution

Blank Lines at the beginning of output csv from Impala-shell

We have a user who is running impala-shell from the edge node of our hadoop cluster. The user is running a query sucessfully and having the output of the query going to a csv. When the user looks at the csv with vim or vi they have two two blank lines before the data from the query shows up. Has anybody else had this problem? The user is able to remove the two blank lines, but is annoyed by this process because it interrupts his workflow.

 

Anybody else have this problem?

 

Impala-shell command

 

impala-shell --ssl -V -i hare1.putnaminv.com:21000 -u cmorris -B -o test.csv --print_header --output_delimiter='|' -f user.sql

 

Example of test.csv

 

----------------------------------------------------

 

 

head header head

data

data

data

Cloudera Employee
Posts: 35
Registered: ‎10-20-2015

Re: Blank Lines at the beginning of output csv from Impala-shell

What version of Impala?

 

Does this happen with -q "show databases" instead of -f user.sql?

Explorer
Posts: 13
Registered: ‎07-26-2016

Re: Blank Lines at the beginning of output csv from Impala-shell

Let me check with my user and see if it makes any difference. I will report back after the user tests

We are running Impala 2.3 from CDH 5.5.4
Explorer
Posts: 13
Registered: ‎07-26-2016

Re: Blank Lines at the beginning of output csv from Impala-shell

Using -q as a flag for Impala shell seemed to make things much worse
Highlighted
Cloudera Employee
Posts: 35
Registered: ‎10-20-2015

Re: Blank Lines at the beginning of output csv from Impala-shell

In what way did it make things worse? When you tried -q, did you drop the "-f user.sql" part off of your command line? Did you add "show databases" right after -q?
Explorer
Posts: 13
Registered: ‎07-26-2016

Re: Blank Lines at the beginning of output csv from Impala-shell

Hi,

So I worked with Cloudera Support, the problem was our user had a comment before the first line of his query.

Example
--comment is here
use database;