首页 > 解决方案 > 错误:启用 Hive 事务并对事务表执行联接查询时,路径不是文件

问题描述

蜂巢版本:1.3.0

我启用 Hive 事务功能,设置

HiveServer 端

hive.support.concurrency=true
hive.enforce.bucketing=true
hive.exec.dynamic.partition.mode=nonstrict
hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager

元存储端

hive.compactor.initiator.on=true
hive.compactor.worker.threads=1

并创建一个事务表,例如:

CREATE TABLE hello_acid (key int, value int)
PARTITIONED BY (load_date date)
CLUSTERED BY(key) INTO 3 BUCKETS
STORED AS ORC TBLPROPERTIES ('transactional'='true');

插入值:

INSERT INTO hello_acid partition (load_date='2016-03-01') VALUES (1, 1);

然后,我运行下面的查询:

SELECT h1.key from hello_acid h1 JOIN hello_acid h2 ON (h1.key = h2.key);

我收到以下错误:

java.io.IOException: java.io.FileNotFoundException: Path is not a file: /user/hive/warehouse/hello_acid/load_date=2016-03-01

标签: joinhive

解决方案


推荐阅读