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

example

CREATE TABLE s3.FOLDERNAME.test
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:

30ca41fa-230a-45f6-8afe-3b6d356b211c.zip (6.4 KB)

failed CTAS:

3ec68427-53fe-4249-82b5-f5785747522c.zip (4.2 KB)

@marvinwu

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

aws s3 ls s3://tmp

Thanks
@balaji.ramaswamy

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