0

I'm trying to use S3 Select Object content to parse a CSV file that has NUL delimiter.

Context of file

The S3 API command I've tried is -

aws s3api select-object-content \
  --bucket "testbucket" \
  --key test.csv.gz \
  --expression "Select * from s3object s" \
  --expression-type 'SQL' \
  --input-serialization '{"CSV": {"FieldDelimiter": "'\0'", "FileHeaderInfo": "IGNORE"}, "CompressionType": "GZIP"}' \
  --output-serialization '{"CSV": {"FieldDelimiter": ","}}' test.csv

This does not seem to work and returns me

enter image description here

Is there any way to use NUL as delimiter for S3 Select Object Content?

maafk
  • 6,176
  • 5
  • 35
  • 58
Krishna
  • 11
  • 3

1 Answers1

0

Using this command worked! :)

Thought it would be useful for someone

aws s3api select-object-content \
  --bucket "testbucket" \
  --key test.csv.gz \
  --expression "Select * from s3object s" \
  --expression-type 'SQL' \
  --input-serialization '{"CSV": {"FieldDelimiter": "", "FileHeaderInfo": "IGNORE"}, "CompressionType": "GZIP"}' \
  --output-serialization '{"CSV": {"FieldDelimiter": ","}}' test.csv
Krishna
  • 11
  • 3