phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "maghamravikiran (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PHOENIX-1050) Can't load pig bytearray into a phoenix VARBINARY column
Date Sun, 21 Sep 2014 18:28:35 GMT

     [ https://issues.apache.org/jira/browse/PHOENIX-1050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

maghamravikiran updated PHOENIX-1050:
-------------------------------------
    Affects Version/s:     (was: 4.0.0)
                           (was: 3.0.0)
                       3.2
                       4.2
                       5.0.0

> Can't load pig bytearray into a phoenix VARBINARY column
> --------------------------------------------------------
>
>                 Key: PHOENIX-1050
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1050
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0, 4.2, 3.2
>            Reporter: Jeffrey Zhong
>            Assignee: maghamravikiran
>             Fix For: 5.0.0, 4.1, 3.2
>
>         Attachments: 0001-PHOENIX-1050.patch, 0001-PHOENIX-1050.patch
>
>
> This issue is found by Daniel Rodriguez and below are the repro steps:
> {noformat}
> Example:
> CREATE TABLE IF NOT EXISTS binary (id BIGINT NOT NULL, binary VARBINARY CONSTRAINT my_pk
PRIMARY KEY (id));
> phoenix> select * from binary;
> +------------+------------+
> |     ID     |   BINARY   |
> +------------+------------+
> +------------+------------+
> > cat testdata.tdf
> 1     10
> 2     20
> 3     30
> grunt> A = load 'testdata.tdf' USING PigStorage('\t') AS (id:long, avro:bytearray);
> grunt> describe A;
> A: {id: long,avro: bytearray}
> grunt> STORE A into 'hbase://BINARY' using org.apache.phoenix.pig.PhoenixHBaseStorage('localhost','-batchSize
1000');
> Is throwing a cannot cast exception:
> java.lang.Exception: java.lang.ClassCastException: org.apache.pig.data.DataByteArray
cannot be cast to [B
>     at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
>     at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)
> Caused by: java.lang.ClassCastException: org.apache.pig.data.DataByteArray cannot be
cast to [B
>     at org.apache.phoenix.schema.PDataType$23.toBytes(PDataType.java:2976)
>     at org.apache.phoenix.schema.PDataType$23.toObject(PDataType.java:3022)
>     at org.apache.phoenix.pig.TypeUtil.castPigTypeToPhoenix(TypeUtil.java:131)
>     at org.apache.phoenix.pig.hadoop.PhoenixRecord.convertTypeSpecificValue(PhoenixRecord.java:87)
>     at org.apache.phoenix.pig.hadoop.PhoenixRecord.write(PhoenixRecord.java:68)
>     at org.apache.phoenix.pig.hadoop.PhoenixRecordWriter.write(PhoenixRecordWriter.java:71)
>     at org.apache.phoenix.pig.hadoop.PhoenixRecordWriter.write(PhoenixRecordWriter.java:41)
>     at org.apache.phoenix.pig.PhoenixHBaseStorage.putNext(PhoenixHBaseStorage.java:151)
>     at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputFormat$PigRecordWriter.write(PigOutputFormat.java:139)
>     at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputFormat$PigRecordWriter.write(PigOutputFormat.java:98)
>     at org.apache.hadoop.mapred.MapTask$NewDirectOutputCollector.write(MapTask.java:646)
>     at org.apache.hadoop.mapreduce.task.TaskInputOutputContextImpl.write(TaskInputOutputContextImpl.java:89)
>     at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.write(WrappedMapper.java:112)
>     at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigMapOnly$Map.collect(PigMapOnly.java:48)
>     at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.runPipeline(PigGenericMapBase.java:284)
>     at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.map(PigGenericMapBase.java:277)
>     at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.map(PigGenericMapBase.java:64)
>     at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
>     at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:775)
>     at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
>     at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:243)
>     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>     at java.lang.Thread.run(Thread.java:744)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message