Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix create table error for file based Hive metastore with S3 #1664

Merged
merged 1 commit into from Nov 17, 2019

Conversation

ryanrupp
Copy link
Member

@ryanrupp ryanrupp commented Oct 4, 2019

S3FileSystem mkdirs doesn't actually do anything since S3 doesn't have the concept of directories. Therefore, trying to create an empty directory and check if it exists would fail since the current directory check for S3FileSystem is checking if any object keys exist under that path. This can be shortcircuited by just checking if the mkdirs call is successful.

@findepi
Copy link
Member

findepi commented Oct 4, 2019

S3FileSystem mkdirs doesn't actually do anything since S3 doesn't have the concept of directories.

eg AWS S3 web ui will let you create "a directory".
These are 0-byte objects with content-type=application/x-directory

@ryanrupp
Copy link
Member Author

ryanrupp commented Oct 4, 2019

Yeah the semantics of "a directory" in S3 sort of depend on the convention the code is using although I guess the S3 web console has the example you've given. In other areas I've seen just the presence of a key with a trailing / or for instance the Presto implementation here is just doing S3 List and checking that keys exists under that path to count it as a directory.

@guyco33
Copy link
Member

guyco33 commented Oct 24, 2019

Fixes #1858

S3FileSystem mkdirs doesn't actually do anything since S3 doesn't have the concept of directories. Therefore, trying to create an empty directory and immediately checking if it exists would fail since the current directory check for S3FileSystem is checking if any object keys exist under that path. This can be shortcircuited by just checking if the mkdirs call is successful.
@findepi findepi merged commit 5c991a5 into trinodb:master Nov 17, 2019
@findepi findepi added this to the 326 milestone Nov 17, 2019
@findepi findepi mentioned this pull request Nov 17, 2019
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants