[
https://issues.apache.org/jira/browse/PIG-3331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13662668#comment-13662668
]
Scott Carey commented on PIG-3331:
----------------------------------
It is possible that the problem is in reading the schema or in other places in
between the Load and Store.
Ideally this process would preserve defaults as well as "doc" and arbitrary
user properties.
> Default values not stored in avro file when using specific schemas during
> store in AvroStorage
> ----------------------------------------------------------------------------------------------
>
> Key: PIG-3331
> URL: https://issues.apache.org/jira/browse/PIG-3331
> Project: Pig
> Issue Type: Bug
> Components: piggybank
> Affects Versions: 0.11.1
> Reporter: Viraj Bhat
> Assignee: Viraj Bhat
> Fix For: 0.11.2
>
>
> Script which stores Avro using a predefined schema does not store the default
> values in the file
> {code}
> a = LOAD 'numbers.txt' USING PigStorage (':') as (intnum1000: int,id:
> int,intnum5: int,intnum100: int,intnum: int,longnum: long,floatnum:
> float,doublenum: double);
> b2 = foreach a generate id, intnum5, intnum100;
> c2 = filter b2 by 110 <= id and id < 120;
> STORE c2 INTO '/tmp/TestAvroStorage/testDefaultValueWrite' USING
> org.apache.pig.piggybank.storage.avro.AvroStorage (' { "debug" : 5, "schema" :
> { "name" : "rmyrecord", "type" : "record", "fields" : [ { "name" : "id",
> "type" : "int" , "default" : 0 }, { "name" : "intnum5", "type" : "int",
> "default" : 0 }, { "name" : "intnum100", "type" : "int", "default" : 0 } ] } }
> ');
> {code}
> Opening the file shows the following schema
> {noformat}
> avro.schema
> {"type":"record","name":"rmyrecord","fields":[{"name":"id","type":"int"},{"name":"intnum5","type":"int"},{"name":"intnum100","type":"int"}]}
> {noformat}
> There seems to be a problem storing the schema.
> Viraj
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira