Support Questions

Find answers, ask questions, and share your expertise

Funny characters in output file from Impala shell

avatar
Expert Contributor

Hi,

I want to output the results of some queries passed to impala-shell (in the real scenario read from an input file) to an output file.  I have observed that when I redirect the output of impala-shell to a file in the normal bash way, there are some funny characters printed at the beginning of each result block ^[[?1034h (please see screenshot below):

 

impala-shell --quiet -i server:port -d database -q "select count(*) as cnt from table1" > output.txt

 

impala shell output.png

 

When the following syntax is used, the funny characters are not printed:

 

impala-shell --quiet -i server:port -d database -q "select count(*) as cnt from table1" -o output.txt

 

Is this a bug in impala-shell or how would I stop those funny characters from appearing? For some other reasons I need to use the standard redirection to a file rather than the -o option.

 

Thanks,

Martin

1 ACCEPTED SOLUTION

avatar
Expert Contributor

This is by design. I forgot the rationale. It can be avoided by setting env variable TERM to linux

 

(for bash and friends)

 

export TERM=linux

 

View solution in original post

2 REPLIES 2

avatar
Expert Contributor

This is by design. I forgot the rationale. It can be avoided by setting env variable TERM to linux

 

(for bash and friends)

 

export TERM=linux

 

avatar
Expert Contributor
This fixes the issue. Thanks a lot for quick reply!