[
https://issues.apache.org/jira/browse/PIG-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13086532#comment-13086532
]
Alan Gates commented on PIG-2217:
---------------------------------
Whether or not Pig will call StoreMetadata.storeSchema when the schema is null
is undefined (that is, the Javadocs in the interface don't specify). Looking
at PigOutputCommiter.storeCleanup (where storeSchema is called) it was
certainly the intention from the beginning that this method should not be
called if the schema was null.
It is clear that storeSchema was not meant to be called in the logical plan
translation. It should be called after the store has finished, not before it
has begun, so removing that call from the front end was correct.
I'm going to close this as invalid, since the proper behavior isn't specified.
If you have a strong reason for believing it should get called then please
re-open the JIRA and provide an argument for changing it.
> POStore.getSchema() returns null if I dont have a schema defined at load
> statement
> ----------------------------------------------------------------------------------
>
> Key: PIG-2217
> URL: https://issues.apache.org/jira/browse/PIG-2217
> Project: Pig
> Issue Type: Bug
> Affects Versions: 0.8.1, 0.9.0
> Reporter: Vivek Padmanabhan
>
> If I don't specify a schema definition in load statement, then
> POStore.getSchema() returns null because of which PigOutputCommitter is not
> storing schema .
> For example if I run the below script, ".pig_header" and ".pig_schema" files
> wont be saved.
> load_1 = LOAD 'i1' USING PigStorage();
> ordered_data_1 = ORDER load_1 BY * ASC PARALLEL 1;
> STORE ordered_data_1 INTO 'myout' using
> org.apache.pig.piggybank.storage.PigStorageSchema();
> This works fine with Pig 0.7, but 0.8 onwards StoreMetadata.storeSchema is
> not getting invoked for these cases.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira