Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

An error occurred retrieving schema from bytes HIVE-HBASE-AVRO


An error occurred retrieving schema from bytes HIVE-HBASE-AVRO

New Contributor

I stored a data with a avro format into a hbase column and I try to mapp the content of this column with a hive table but I had a below error :

My table hive is :

    DROP TABLE IF EXISTS luxdwh.smsc_agg_hbase;
    CREATE EXTERNAL TABLE luxdwh.smsc_agg_hbase (
    ROW FORMAT SERDE 'org.apache.hadoop.hive.hbase.HBaseSerDe'
    STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
        "hbase.columns.mapping" = ":key, smsc_agg:message",
        "smsc_agg.message.serialization.type" = "avro",
        "smsc_agg.message.avro.schema.url" = "schema.avsc")
        "" = "smsc_agg",

>     2018-03-22 09:54:30,368 INFO [AsyncDispatcher event handler]
> Diagnostics report from attempt_1521646867123_0065_m_000000_2: Error:
> java.lang.RuntimeException:
> org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error
> while processing row [Error getting row data with exception
> org.apache.hadoop.hive.serde2.avro.AvroObjectInspectorException: An
> error occurred retrieving schema from bytes
>         at org.apache.hadoop.hive.serde2.avro.AvroLazyObjectInspector.retrieveSchemaFromBytes(
>         at org.apache.hadoop.hive.serde2.avro.AvroLazyObjectInspector.deserializeStruct(
>         at org.apache.hadoop.hive.serde2.avro.AvroLazyObjectInspector.getStructFieldData(
>         at org.apache.hadoop.hive.serde2.lazy.objectinspector.LazySimpleStructObjectInspector.getStructFieldData(
>         at org.apache.hadoop.hive.serde2.SerDeUtils.buildJSONString(
>         at org.apache.hadoop.hive.serde2.SerDeUtils.getJSONString(
>         at org.apache.hadoop.hive.serde2.SerDeUtils.getJSONString(
>         at org.apache.hadoop.hive.ql.exec.MapOperator.toErrorMessage(
>         at org.apache.hadoop.hive.ql.exec.MapOperator.process(
>         at
>         at
>         at org.apache.hadoop.mapred.MapTask.runOldMapper(
>         at
>         at org.apache.hadoop.mapred.YarnChild$
>         at Method)
>         at
>         at
>         at org.apache.hadoop.mapred.YarnChild.main(
>     Caused by: Invalid int encoding
>         at
>         at
>         at org.apache.avro.file.DataFileStream.initialize(
>         at org.apache.avro.file.DataFileStream.<init>(
>         at org.apache.hadoop.hive.serde2.avro.AvroLazyObjectInspector.retrieveSchemaFromBytes(
>         ... 17 more



Re: An error occurred retrieving schema from bytes HIVE-HBASE-AVRO

New Contributor

Hi were you able to resolve this issue? I am facing exact same error and trying to load hbase column data into hive. Any help is appreciated. 

Don't have an account?
Coming from Hortonworks? Activate your account here