Reputation: 31
I am trying to run below impala query to get the table count from shell scripting.
Select count(*) as count from impala table name.
1000
I need to capture 1000 into shell variable to be used in some calculation. Can some one help how to do this. Thanks.
Upvotes: 1
Views: 1628
Reputation: 1067
This should work
x="$(impala-shell -q 'select count(*) from table_name' -B)"
echo "$x"
Upvotes: 1