If you wish to reference a file in S3 from a pig script you might do something like this:
set fs.s3n.awsSecretAccessKey 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
set fs.s3n.awsAccessKeyId 'xxxxxxxxxxxxxxxxxxxxx';
A = load 's3n://<bucket>/<path-to-file>' USING TextLoader;
If you're on HDP 2.2.6, you'll likely see this error:
Error: java.io.Exception, no filesystem for scheme: s3n
s3n is deprecated in newer versions of Hadoop (see https://wiki.apache.org/hadoop/AmazonS3), so it's better to use s3a. To use s3a, specify s3a:// in front of the path when accessing files.
The following properties need to be configured first: