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



0
how to define schema in CSVExcelStorage function?

Is there any good material for Pig?

1 Answer(s)


0

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.

Example:

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