-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Forbid scheme://authority locations (without trailing slash) #17923
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
Conversation
plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestHiveMinioQueries.java
Outdated
Show resolved
Hide resolved
a1dde16
to
dd7ddd8
Compare
@electrum @findinpath @alexjo2144 @losipiuk what is the best way to block locations like |
dd7ddd8
to
c907053
Compare
s3://bucket
c907053
to
804b353
Compare
I added commit forbidding such locations and renamed the PR accordingly. |
plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestHiveS3MinioQueries.java
Show resolved
Hide resolved
It may not be straightforward for the end user to specify the table path as When the metastore is HMS, the creation of the table / schema was supposed to be suffixed with
I'm actually still rather confused regarding the HMS behavior:
From end user perspective, it is rather uneasy to understand the reasoning behind this functionality choice on HMS.
UPDATE 16.06.2023 I thought through my point about simplicity of use from end user perspective. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Using top of the bucket as table location realistically will not be used anyway (that is my guess). It would not give us much to add behind the scenes normalization here, and it is a bit against principle of least supprise (if I specified location to X I would expect it to be set to X, not to X/). |
lib/trino-filesystem/src/main/java/io/trino/filesystem/Location.java
Outdated
Show resolved
Hide resolved
lib/trino-filesystem/src/test/java/io/trino/filesystem/TestLocation.java
Show resolved
Hide resolved
lib/trino-filesystem/src/test/java/io/trino/filesystem/local/TestLocalFileSystem.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestHiveS3MinioQueries.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will cause compatibility issues with other software (e.g. Athena), so forbid them
IIRC our compatibility target is Hive, not Athena - which is also based on Trino. And it seems Hive has no problem with such tables.
In practice I've seen a table per bucket as well.
This I partially agree with - |
stale, seems only s3://bucket stops working, not s3://bucket/
plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestHiveS3MinioQueries.java
Show resolved
Hide resolved
lib/trino-filesystem/src/main/java/io/trino/filesystem/Location.java
Outdated
Show resolved
Hide resolved
In other places in `Location` class the location toString is not in apostrophes, so let's change this one place not to use apostrophes either.
Assert on full message, not a single word contained within.
Note: this documents current state, but does not imply the intent to support such locations.
804b353
to
927ea05
Compare
Test Hive connector behavior when table location is top-of-bucket, but without slash at the end (`s3://bucket` and not `s3://bucket/`). As seen, the behavior is not fully coherent, so maybe it would be better to disallow such locations. FWIW, such locations aren't supported in Athena.
927ea05
to
5508c66
Compare
Locations like `s3://bucket` aren't consistently supported in Trino yet and will cause compatibility issues with other software (e.g. Athena), so forbid them. They may be allowed later.
5508c66
to
c1cd116
Compare
Question @findepi and @martint .. with that also apply to other S3 related paths and config, and specifically also the docs. For example we have
Will that fail? And also
Will that fail to? Or generically .. should we just make sure that all of these (also for others like gcs and abfs) always have the trailing slash in the docs everywhere? |
Might. I don't know.
No. Only |
@arhimondr @linzebing .. could you verify and maybe send a PR to update the docs? |
It will not - actually top of the bucket is configuration we use in unit tests. |
Locations like
s3://bucket
aren't consistently supported in Trino yetand will cause compatibility issues with other software (e.g. Athena),
so forbid them. They may be allowed later.
Fixes #17921