通过外壳运行蜂巢命令获取错误

时间:2020-03-03 08:12:16

标签: shell hadoop hive hiveql

hive -e "select key from hbcv_table a where a.col2 like \'%hello friend%\'" | sed 's/[\t]/,/g'  >a.dat

得到类似-

的错误

寻找匹配的“”“时出现意外的EOF

任何人都可以帮助解决该问题。

1 个答案:

答案 0 :(得分:0)

无需屏蔽单引号:

hive -e "select key from hbcv_table a where a.col2 like '%hello friend%'" | sed 's/[\t]/,/g'  >a.dat

应该将select语句中的单引号直接传递给Hive。在双引号中,单引号具有字面意思。

相关问题