我已经通过 Nutch 2.3.1 爬取了一些数据。数据存储在 Hbase 0.98 表中。我创建了一个从 hbase 表导入数据的外部表。现在我必须将此数据索引到 solr 4.10.3。为此,我关注了this。众所周知的教程。我已经像这样创建了配置单元表
create external table if not exists solr_items (
id STRING,
content STRING,
url STRING,
title STRING
) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|'
stored by "com.chimpler.hive.solr.SolrStorageHandler"
with serdeproperties ("solr.column.mapping"="id,content,url,title")
tblproperties ("solr.url" = "http://localhost:8983/solr/collection1") ;
当我尝试从发布的 hbase 复制数据时出现了一些问题 here .然后我决定首先索引一些虚拟数据。为此,我决定从像
这样的文件中加载数据LOAD DATA LOCAL INPATH 'data.csv3' OVERWRITE INTO TABLE solr_items;
但它给出了以下错误
FAILED: SemanticException [Error 10101]: A non-native table cannot be used as target for LOAD
问题出在哪里 HADOOP版本为1.2.1
最佳答案
您不能对外部表使用LOAD DATA
。 Hive LanguageManual DML :
Hive does not do any transformation while loading data into tables. Load operations are currently pure copy/move operations that move datafiles into locations corresponding to Hive tables.
在 Solr 外部表的情况下,Hive 显然不能只复制数据,因为 Solr 使用它自己的内部数据表示。
虽然你可以插入:
insert into table solr_items select * from tempTable;
关于hadoop - 通过 Hive 外部表将 Hbase 数据索引到 solr,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40130657/