Home Forums Hive / HCatalog The query from HIVE to HBASE with 'where' does not work.

This topic contains 0 replies, has 1 voice, and was last updated by  Sergey Sukharev 9 months, 1 week ago.

  • Creator
    Topic
  • #49177

    Sergey Sukharev
    Participant

    The table was created from HIVE:

    CREATE TABLE hbase_job
    (
    id int,
    name string
    )
    STORED BY ‘org.apache.hadoop.hive.hbase.HBaseStorageHandler’
    WITH SERDEPROPERTIES (“hbase.columns.mapping” = “:key,cf:name”)
    TBLPROPERTIES(“hbase.table.name” = “hbase_job”)

    hbase(main):001:0> scan ‘hbase_job’
    ROW COLUMN+CELL
    1 column=cf:name, timestamp=1393254158657, value=Secretary
    2 column=cf:name, timestamp=1393254158657, value=Manager
    3 column=cf:name, timestamp=1393254158657, value=Sales Person
    4 column=cf:name, timestamp=1393254158657, value=Managing Director
    5 column=cf:name, timestamp=1393254158657, value=Director
    6 column=cf:name, timestamp=1393254158657, value=Mechanic
    7 column=cf:name, timestamp=1393254158657, value=Foreman
    8 column=cf:name, timestamp=1393254158657, value=Clerk
    9 column=cf:name, timestamp=1393254158657, value=Accountant
    9 row(s) in 0.1240 seconds

    hive> use motors;
    OK
    Time taken: 1.225 seconds
    hive> select count(*) from hbase_job;
    Total MapReduce jobs = 1
    Launching Job 1 out of 1

    MapReduce Jobs Launched:
    Job 0: Map: 1 Reduce: 1 Cumulative CPU: 4.36 sec HDFS Read: 279 HDFS Write: 2 SUCCESS
    Total MapReduce CPU Time Spent: 4 seconds 360 msec
    OK
    9
    Time taken: 23.266 seconds, Fetched: 1 row(s)

    hive> select * from hbase_job where id=8;
    Total MapReduce jobs = 1
    Launching Job 1 out of 1

    MapReduce Jobs Launched:
    Job 0: Map: 1 Cumulative CPU: 3.12 sec HDFS Read: 282 HDFS Write: 8 SUCCESS
    Total MapReduce CPU Time Spent: 3 seconds 120 msec
    OK
    8 Clerk
    Time taken: 15.394 seconds, Fetched: 1 row(s)

    But next query gives me an error:

    hive> select * from hbase_job where name=’Clerk';
    Total MapReduce jobs = 1
    Launching Job 1 out of 1

    Job Submission failed with exception ‘java.lang.RuntimeException(Unexpected residual predicate (name = ‘Clerk’))’
    FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

    Is anybody knows what could be the cause of the error? I would be very grateful for any help.

    Sergey

You must be logged in to reply to this topic.