3
votes

I've created a Hbase table like this,

create 'student','personal'

and I've put some data into it like this.

    ROW                         COLUMN+CELL
 1 column=personal:age, timestamp=1456224023454, value=20

 1 column=personal:name, timestamp=1456224008188, value=pesronA

 2                          column=personal:age, timestamp=1456224891317, value=13

 2                          column=personal:name, timestamp=1456224868967, value=pesronB

 3                          column=personal:age, timestamp=1456224935178, value=21

 3                          column=personal:name, timestamp=1456224921246, value=personC

 4                          column=personal:age, timestamp=1456224951789, value=20

 4                          column=personal:name, timestamp=1456224961845, value=personD


 5                          column=personal:age, timestamp=1456224983240, value=20

 5                          column=personal:name, timestamp=1456224972816, value=personE


-

I want to import this data to a hive table. I wrote a hive query for that like this

CREATE TABLE hbaseStudent(key INT,name STRING,age INT) STORED BY'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,personal:age,personal:name") TBLPROPERTIES("hbase.table.name" = "student")

But when I execute the query error comes out like this.

Driver returned: 1. Errors: OK FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. org/apache/hadoop/hbase/HBaseConfiguration

what should i do?

1
You are just creating a way to query hbase data through hive interface, you are not importing data from hbase -> hive (hdfs).spats

1 Answers

1
votes

I tried this thing and it worked try replacing all the double quotes (") with single quotes ('). It will work & also try to add terminator ; in last line.