Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution

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

Explorer

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

Explorer
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;
5 REPLIES 5

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

Contributor

What version of Impala?

 

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

Highlighted

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

Explorer
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

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

Explorer
Using -q as a flag for Impala shell seemed to make things much worse

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

Contributor
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?

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

Explorer
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;