Example: Upload a text file to the file system and use Pig to save it as an ORC file
Procedure
-
Upload the file to the file system:
cd /home/mapr sudo -u mapr hadoop fs -put ./test_pig.data /test_pig.data sudo -u mapr hadoop fs -mkdir /output
-
Start Pig and save the text file in ORC format:
sudo -u mapr pig grunt> A = LOAD '/test_pig.data' using PigStorage(',') AS (first_name:chararray, last_name:chararray); grunt> store A into '/output/A' using OrcStorage('');
-
Verify that the ORC file was created:
hadoop fs -ls /output/A/