Hadoop hbase到配置单元集成失败

Hadoop hbase到配置单元集成失败,hadoop,hive,hbase,bigdata,hiveql,Hadoop,Hive,Hbase,Bigdata,Hiveql,我在“hbase”表中有行、列系列h1,其中有两个值id和名称 “hbase_样本”。 我想在配置单元中创建具有id和name列的外部表,但我不想 要写入行或键字段 hive> create external table sample (id string,name string) > STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' > with serdeproperties ("hba

我在“hbase”表中有行、列系列h1,其中有两个值id和名称 “hbase_样本”。 我想在配置单元中创建具有id和name列的外部表,但我不想 要写入行或键字段

hive> create external table sample (id string,name string)
    > STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
    > with serdeproperties ("hbase.columns.mapping"=":key,h1:id,h1:name")
    > tblproperties("hbase.table.name"="sample_hbase");

FAILED: Execution Error, return code 1 from 
org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: 
MetaException(message:org.apache.hadoop.hive.serde2.SerDeException 
org.apache.hadoop.hive.hbase.HBaseSerDe: columns has 2 elements while 
hbase.columns.mapping has 3 elements (counting the key if implicit))

通过查看错误消息,HBase似乎有三列,如rowid、id和name。创建包含两列(即id和名称)的配置单元表时。
创建包含所有三列的配置单元表,并将其命名为table\u name\u temp table。一旦临时表存在,从配置单元中的临时表创建两列表,然后删除临时表。查看此解决方案是否适用于您。

这样可以,但我不想在配置单元表中写入键(rowid)列,因为它有一些ascii值,这会导致配置单元表数据的格式不正确。因此,我想跳过第一列。您可以将包含三列的原始表作为临时表,并从临时表中创建包含选定两列的新表,然后删除临时表。但在加载原始表时,由于ascii值的原因,无法以正确的格式加载。这就是问题所在。行id是哈希值,这不是问题,问题是您正在尝试修复另一个两列表中的三列表,这就是问题所在,请参阅错误消息,错误就在于此。这里的主要问题是从hbase文件中读取ascii字符