I have a number of SQL queries that use a common set of parameters (variables). Currently, parameters are set
at the top of each file. When any parameter changes, it has to be changed in every file. It would be beneficial to be able to have the parameters in a separate file and changed in only one place.
How can this be accomplished?
I realize that I can use the --var
option to impala-shell
, but this means that these have to be entered multiple times.
I can see several ways that this might happen:
impala-shell
might support multiple-f
arguments: This would be very elegant, but it doesn't.The queries can be
cat
'd together and piped intoimpala-shell
. This is serviceable but inelegant.An alias can be set for
impala-shell
that specified--var
arguments. This is potentially hard to get right.
Clearly #1 would be the best solution, but is there any other options or advice.
Not quite related: Multiple query execution in cloudera impala