HIVE CREATE TABLE sematicException 0:0

时光毁灭记忆、已成空白 提交于 2019-12-24 19:35:43

问题


HI, all :
i am newbie at hive, i got this error when i was creating a table using "select from " syntax,
my input is as following:

`hive>create table longyuan_web.tmp_recent_week_data_cookies as 
 select u from longyuan_web.ods_mbw_user_pv where dt>='2018-07-19' 
 and dt<='2018-07-25'and  platform='31' 
 and u is not null and length(u)>=32
 and os='ios' group by u`

i get this error:
FAILED: SemanticException 0:0 Error creating temporary folder on: hdfs://hadoop-bd-ns01/hive/warehouse/longyuan_web.db. Error encountered near token 'TOK_TMP_FILE'

i am pretty sure i am on the right cluster and the original table is also on this cluster
what this 'TOK_TMP_FILE'?
thank you so much!!


回答1:


Mostly the issue is user doesn't have access to write to longyuan_web database.

Please check that you have correct permissions and then try to execute then execute CTAS again.

Jira ticket addressing same exact issue is here




回答2:


That's right.

(I assume Your select query runs good as stand-alone)

You have read access in longyuan_web db. But not write access.

Work around is... Try to create the table in some other db where you have write access, like....

 `hive>create table **xxx_web**.tmp_recent_week_data_cookies as select u from longyuan_web.ods_mbw_user_pv where dt>='2018-07-19' and dt<='2018-07-25'and platform='31' and u is not null and length(u)>=32 and os='ios' group by u` as select u from longyuan_web.ods_mbw_user_pv where dt>='2018-07-19' and dt<='2018-07-25'and platform='31' and u is not null and length(u)>=32 and os='ios' group by u`

Where xxx_web is the Db where you have write access.



来源:https://stackoverflow.com/questions/51535822/hive-create-table-sematicexception-00

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!