hive insert 動態分區異常(Error encountered near token)與解決


 

當insert數據到有分區的hive表里時若不明顯指定分區會拋出異常

insert overwrite table persons_tmp select * from persons;

 

FAILED: SemanticException 1:23 Need to specify partition columns because the destination table is partitioned. Error encountered near token 'persons_tmp'

 

當指定分區后又會有非嚴格模式異常

insert overwrite table persons_tmp partition(dt,bs)  select * from persons;

 

FAILED: SemanticException [Error 10096]: Dynamic partition strict mode requires at least one static partition column. To turn this off set hive.exec.dynamic.partition.mode=nonstrict

 

此時依據錯誤提示set好非嚴格模式即可

set hive.exec.dynamic.partition.mode=nonstrict;
insert overwrite table persons_tmp partition(dt,bs) select * from persons;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM