You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by John Smith <le...@gmail.com> on 2016/01/11 18:03:19 UTC

Casting

Hi,

Im trying to dump relation into AVRO file but im getting strange error:
 org.apache.pig.data.DataByteArray cannot be cast to java.lang.CharSequence

I dont use DataByteArray (bytearray), see description of the relation
below.

sensitiveSet: {rank_ID: long,name: chararray,customerId: long,VIN:
chararray,birth_date: chararray,fuel_mileage: chararray,fuel_consumption:
chararray}


STORE sensitiveSet INTO 'testOut2222.avro'
USING org.apache.pig.piggybank.storage.avro.AvroStorage('no_schema_check',
'schema',
'{"type":"record","name":"xxxx","namespace":"","fields":[{"name":"rank_ID","type":"long"},{"name":"name","type":"string","store":"no","sensitive":"na"},{"name":"customerId","type":"string","store":"yes","sensitive":"yes"},{"name":"VIN","type":"string","store":"yes","sensitive":"yes"},{"name":"birth_date","type":"string","store":"yes","sensitive":"no"},{"name":"fuel_mileage","type":"string","store":"yes","sensitive":"no"},{"name":"fuel_consumption","type":"string","store":"yes","sensitive":"no"}]}');


Thank you

Re: Casting

Posted by John Smith <le...@gmail.com>.
Even when I do explicit casting im getting same error:

sensitiveSet = foreach sensitiveSet generate (long) $0, (chararray) $1,
(long) $2, (chararray) $3, (chararray) $4, (chararray) $5;

On Mon, Jan 11, 2016 at 6:03 PM, John Smith <le...@gmail.com> wrote:

> Hi,
>
> Im trying to dump relation into AVRO file but im getting strange error:
>  org.apache.pig.data.DataByteArray cannot be cast to java.lang.CharSequence
>
> I dont use DataByteArray (bytearray), see description of the relation
> below.
>
> sensitiveSet: {rank_ID: long,name: chararray,customerId: long,VIN:
> chararray,birth_date: chararray,fuel_mileage: chararray,fuel_consumption:
> chararray}
>
>
> STORE sensitiveSet INTO 'testOut2222.avro'
> USING org.apache.pig.piggybank.storage.avro.AvroStorage('no_schema_check',
> 'schema',
> '{"type":"record","name":"xxxx","namespace":"","fields":[{"name":"rank_ID","type":"long"},{"name":"name","type":"string","store":"no","sensitive":"na"},{"name":"customerId","type":"string","store":"yes","sensitive":"yes"},{"name":"VIN","type":"string","store":"yes","sensitive":"yes"},{"name":"birth_date","type":"string","store":"yes","sensitive":"no"},{"name":"fuel_mileage","type":"string","store":"yes","sensitive":"no"},{"name":"fuel_consumption","type":"string","store":"yes","sensitive":"no"}]}');
>
>
> Thank you
>
>