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
  • 881
  • 2
  • 12
  • 36

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,040
  • 3
  • 15
  • 37