Hive conf issue

Hive --hiveconf v1="test" --hiveconf v2 -e "select * from ${hiveconf:v1} where col1='${hiveconf:v2}' ";

When we run this in linux, shell will parse the ${hiveconf:v1} as a linux variable. It will cause hive error.

Can not parse exception in put …

You can add \ before $ in -e to escapes this.

   

The another issue is in linux shell, * will parse to everything in current folder.

Pay attention to this.

when we change environment to cdh 5.3, then we use beeline.

beeline -n user -n url -e "select * from length(regex_replace('\\D','')>10"

it doesn't work .

we should replace to

beeline -n user -n url -e "select * from length(regex_replace('\\\\D','')>10"

when you execute in beeline console like:

***********************database>select * from length(regex_replace('\\D','')>10;

it will work.

it is wierd.

 

posted on 2015-07-14 09:12  tneduts  阅读(300)  评论(0编辑  收藏  举报

导航