I think it is not stand to connect to a DB with impala.
Maybe the {ssh}
can be of help here:
With this, you may be able to send SQL by ssh to the database shell. I did not test it;
Some other ideas,
-
dplyr could be use to generate the query from R code by printing the query with show_query
-
glue as a glue_sql function that could help build query too.
I let you try this. Hope it helps (... a little)