Forbid scheme://authority locations (without trailing slash)#17923
Forbid scheme://authority locations (without trailing slash)#17923
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://bucketc907053 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. |
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
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://bucketaren'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