hive函数spilt中分号";"作为分隔符报错的问题解决

hive函数spilt中分号”;”作为分隔符报错的问题解决

hive表中有一列值,是以;分隔的,使用sql语句在hub中查询,会报一下异常:

select
  totalprice,
  email 
from
  prd_updated.ecom_ms_order_udl m lateral view explode(split ( m.p_ccemailaddress,
  ';')) adtable as email 
where
  email !=''
Error while compiling statement: FAILED: ParseException line 7:0 cannot recognize input near '' '' '' in select expression

最后发现是分号的问题,因为分号是sql的结束符,在HDFS中识别不了,因此需要用分号的二进制\073来表示,比如:

select
  totalprice,
  email 
from
  prd_updated.ecom_ms_order_udl m lateral view explode(split ( m.p_ccemailaddress,
  '\073')) adtable as email 
where
  email !=''

你可能感兴趣的:(大数据,hive)