Strange behaviour for CTAS to S3

I am trying to create a new table and export to s3 source. the source is map to a s3 bucket


AS select * from testData.testData LIMIT 4

the CTAS will work if I have another bucket named FOLDERNAME, otherwise it would fail. complainting “Cannot create the table because ‘FOLDERNAME’ bucket does not exist”

what do i missed ?

Attached two query profile below: one failed one sucess, only difference is I have created another bucket named dremiotest123 in s3 account.

success CTAS: (6.4 KB)

failed CTAS: (4.2 KB)


Are you able to access the bucket “tmp” via AWS CLI or AWS GUI?

aws s3 ls s3://tmp


@balaji , no the tmp bucket is not exist in my account, i just used it to illustrate the problem.