S3 Select ignores rows starting with #

0

Hi, I have uploaded a csv file to bucket, contents being

A,B
0,1
#1,2
1,2

I used the query SELECT * FROM s3object The result returned dropped the row starting with #.

A,B
0,1
1,2

If I download the file, the file still contains the row #1,2 Is this a known limitation? Any help is appreciated.

Ben
질문됨 2달 전125회 조회
1개 답변
2
수락된 답변

Yes, what you're observing is actually an expected behavior when querying CSV files stored in Amazon S3 using SQL with AWS S3 Select or Amazon Athena. These services allow you to run SQL queries directly against files in S3 without needing to load them into a database. However, when working with CSV files, both S3 Select and Athena treat lines that start with # as comments by default. This is why the row starting with # is being skipped in your query results.

The reason for this behavior is based on a common convention in many CSV and text file formats where lines beginning with # are considered as comments and are therefore ignored during processing. This can be particularly useful for including metadata or comments within a file that should not be treated as data.

You can see the example below:

example

profile picture
전문가
답변함 2달 전
profile pictureAWS
전문가
검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠