1-844-696-6465 (US)        +91 77600 44484        help@dezyre.com

piggybank.pig - how to define schema in CSVExcelStorage function?

how to define schema in CSVExcelStorage function?

Is there any good material for Pig?

1 Answer(s)


hi Venkata,

Follow the below steps

Loading Data from CSV files

You can use CSVExcelStorage to load your data as such:

data = LOAD 's3n://my-s3-bucket/path/to/csv/file'
USING org.apache.pig.piggybank.storage.CSVExcelStorage()
AS (field1: int, field2: chararray);

Storing Pig Output in CSV Format

You can store the output of a Pig script in CSV format using CSVExcelStorage as well.


STORE result INTO 's3n://my-s3-bucket/path/to/output' USING org.apache.pig.piggybank.storage.CSVExcelStorage();

Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)