2

I need to store the result of an Impala query in a text file with no other information but the data itself. For example: select distinct yrmth from test.abc It should write: 201705 201706 etc. in a text file line by line.

Any leads?

Balajee Venkatesh
  • 1,041
  • 2
  • 18
  • 39

1 Answers1

2

impala-shell is well documented. You should try reading the help manual first. Anyway, here is your answer.

impala-shell -q 'select distinct yrmth from test.abc' -B -o res.txt
Amos
  • 3,238
  • 4
  • 19
  • 41