Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (2)

PROBLEM:

For an external hive table created based on hbase, if there are any missing mappings or any other issues (Syntactical), create table statement is executed successfully. You can see the table is created. However, while trying to insert data in that table, following error is seen:

08S01: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Vertex failed, vertexName=Map 1, vertexId=vertex_1495472057323_3947_1_00, Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.serde2.SerDeException: java.lang.ClassCastException: org.apache.hadoop.hive.serde2.lazy.objectinspector.primitive.LazyStringObjectInspector cannot be cast to org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector 

at org.apache.hadoop.hive.ql.exec.FileSinkOperator.process(FileSinkOperator.java:800) 

at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:838) 

at org.apache.hadoop.hive.ql.exec.SelectOperator.process(SelectOperator.java:88) 

at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:838) 

at org.apache.hadoop.hive.ql.exec.TableScanOperator.process(TableScanOperator.java:133) 

at org.apache.hadoop.hive.ql.exec.MapOperator$MapOpCtx.forward(MapOperator.java:170) 

at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:555)

ROOT CAUSE

Per: https://wiki.apache.org/hadoop/Hive/HBaseIntegration?action=diff&rev1=13&rev2=14

If there are any issues with the section:

WITH SERDEPROPERTIES ( "hbase.columns.mapping" = "cf1:val", "hbase.table.name" = "xyz" ); 

while creating the table, then the CREATE TABLE will succeed, but attempts to insert data will fail with this internal error:

{{{ java.lang.RuntimeException: org.apache.hadoop.hive.serde2.lazy.objectinspector.primitive.LazyStringObjectInspector cannot be cast to org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector }}} 

RESOLUTION

Create table should have clear definition of mappings to hbase table. Refer: https://cwiki.apache.org/confluence/display/Hive/HBaseIntegration

1,319 Views
Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎06-30-2017 06:05 AM
Updated by:
 
Contributors
Top Kudoed Authors