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?

Here's a screenshot of my settings

enter image description here

Paolo
  • 21,270
  • 6
  • 38
  • 69
lclankyo
  • 221
  • 3
  • 10
  • 1
    I can reproduce this. Looks like a bug to me – Paolo Jul 31 '22 at 17:23
  • That's unfortunate. It seems it's a problem specifically on the last column. If you add another column, it starts working. – lclankyo Jul 31 '22 at 21:31
  • 1
    [It worked fine for me](https://i.stack.imgur.com/ZQM9k.png) -- I received an output of `ddd,ddd,4,aaa`. I did it with both LF and CRLF file formats. What happens if you try `WHERE loc like 'aaa%'`, in case there's a bad character at the end of the line? – John Rotenstein Jul 31 '22 at 22:34
  • @JohnRotenstein When I do like 'aaa%', it picks it up. But doing equal still fails. Very strange. What could this mean? When I try to dl the file, it shows crlf – lclankyo Aug 01 '22 at 02:20
  • It worked for me with both LF and CRLF. Did you try saving it as just LF? How is the CSV file being generated? – John Rotenstein Aug 01 '22 at 02:57
  • I'm just opening up notepad++ on windows 10, saving it, and then uploading it to s3. When I convert it to LF, it seems to work just fine. – lclankyo Aug 01 '22 at 03:06

0 Answers0