0
votes

Ignore above query. Its incorrect.

I have following pig script A = LOAD 'textinput' using PigStorage() as (a0:chararray, a1:chararray, a2:chararray, a3:chararray, a4:chararray, a5:chararray, a6:chararray, a7:chararray, a8:chararray,a9:chararray); describe A; store A into 'output2' using PigStorage();

This works fine.

However when i modify the store statement to store A into 'output3' using PigStorage() as (a0:chararray, a1:chararray, a2:chararray, a3:chararray, a4:chararray, a5:chararray, a6:chararray, a7:chararray, a8:chararray,a9:chararray);

It fails with below error 2013-05-04 11:49:56,296 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: mismatched input 'as' expecting SEMI_COLON

1

1 Answers

1
votes

You don't specify a schema when storing an output with pig. The schema of the alias you're storing is whatever it was when you created it. If you wished to change the way it's stored you could do something like

B = FOREACH A GENERATE (insert transformation here);
STORE B INTO 'output3';

If you wished to change the way PigStorage writes your alias to disk you could create your own StoreFunc