建表
CREATE TABLE xy_temp.sample_table2(
`uid` string COMMENT '用户uid',
`user_type` string comment '用户类型',
`amount` bigint comment '金额',
`xy_date` string comment '日期'
)
COMMENT '样表'
STORED AS orc
;
插入
insert into xy_temp.sample_table2 values ('111', '1', 1, '20190101');
报错
Error: org.apache.spark.sql.AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to move source hdfs://xydwns/user/hive/warehouse/xy_temp.db/sample_table2/.hive-staging_hive_2019-11-27_15-25-18_808_6513022046765405274-10/-ext-10000/part-00000-c7cd5730-04cd-4261-bfe7-4c50c7a7128a-c000 to destination hdfs://xydwns/user/hive/warehouse/xy_temp.db/sample_table2/part-00000-c7cd5730-04cd-4261-bfe7-4c50c7a7128a-c000; (state=,code=0)
解决
禁用FileSystem缓存,hive-site.xml添加配置
<property>
<name>fs.hdfs.impl.disable.cache</name>
<value>true</value>
</property>