AWS S3 Select CSV WHERE filtering not working on last column

0

I have a csv file in my s3 that looks like this

name,status,age,loc
aaa,aaa,1,zz
bbb,bbb,2,yy
ccc,,3,pp
ddd,ddd,4,aaa


SELECT * FROM s3object s WHERE name ='aaa' This query returns first row correctly.

SELECT * FROM s3object s WHERE loc ='aaa' This query does not return anything, but I expected it to return the last row.

Filtering on status also seems to work fine. Is there a reason why SELECT * FROM s3object s WHERE loc ='aaa' is not working or is there a bug?

I've tried modifying the csv to make loc the first column and name the last column. When I do this, loc works, but then name doesn't work.' I've also tried adding another column so that loc is no longer the last row. When I do this, name works, and suddenly loc works again, but the added last column doesn't work.

It seems like this bug is specific to the last column.

It also seems that doing WHERE loc like 'aaa%' works. What could this mean? When I download the file the linebreak is crlf.

Edit*: It seems that it works fine when the linebreak is LF instead of CRLF.

Here's a screenshot of my settings Enter image description here

질문됨 2년 전528회 조회
1개 답변
0

I have uploaded the data you provided and ran the query that was not working for you with same settings as yours and was able to retrieve results. I would check to make sure there isn't a type in the query Here is a screenshot of the results

AWS
Soumya
답변함 2년 전
  • I posted this problem in stackoverflow and two people tried as well. One person got same problem as me and the other person can't reproduce.

    Are you using LF or CRLF for the line break? My file is in CRLF. When you say "I would check to make sure there isn't a type in the query", what do you mean?

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

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

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