Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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!