我在while循环中运行一个impala查询,为此我创建了一个单独的查询文件,并从shell脚本中调用它。我的问题是,我们能否在查询文件中传递与impala查询匹配的shell变量。
A="INSERT_SBP_ME_VS_ME_INCOME_LAST_THIRTY_DAYS_Q"${Count}
echo "value of A is $A"
source ${SBP2_MNY_IN_LAST_THIRTY_DAYS_QF}
${IMPALA_CON} -q "${${A}}"
A value is like INSERT_SBP_ME_VS_ME_INCOME_LAST_THIRTY_DAYS_Q1 (as count is 1)
I am doing this in this way but getting bad substitution error and I also tried
${IMPALA_CON} -q "${A}" but not getting any successful result
1条答案
按热度按时间dw1jzc5e1#
不确定这是不是你要找的。
下面是一个如何将参数化查询存储在文件中的示例
可以通过 Impala 壳来执行