有人能告诉我这段代码出了什么问题吗?如果我只运行select语句,那么它将返回结果。
如果我删除其中一行";位置";或";存储为文本文件";。此外,如果我也可以指定"分隔符",请告诉我。
create table exploderesults
location '/user/cloudera/sometest'
stored as textfile
as
select id,ph as phone, ct as city from explodetest
lateral view explode(phone)p as ph
lateral view explode(city)c as ct;
感谢
交换两行stored as
和location
。它们必须按照手册的特定顺序
create table exploderesults
stored as textfile
location '/user/cloudera/sometest'
as
select id,ph as phone, ct as city from explodetest
lateral view explode(phone)p as ph
lateral view explode(city)c as ct;
如果要指定分隔符,
create table exploderesults
row format delimited fields terminated by ','
stored as textfile
location '/user/cloudera/sometest'
as
select id,ph as phone, ct as city from explodetest
lateral view explode(phone)p as ph
lateral view explode(city)c as ct;