Conversation
|
@flinkbot run azure |
| } | ||
|
|
||
| public static String extractKey(String s3Uri) { | ||
| String uri = s3Uri.replaceFirst(S3A, S3); |
There was a problem hiding this comment.
nit: now that extractKey(Path) and extractKey(String) live side by side in the same class, they still use two completely different parsing strategies (one via Path/URI, the other via manual indexOf/substring). Was consolidating them into one implementation considered, or is keeping them separate intentional?
There was a problem hiding this comment.
thanks , made changes
| * | ||
| * <p><b>S3 URI Handling:</b> The {@link #extractKey(Path)} and {@link #extractBucketName(Path)} | ||
| * methods expect URIs in the standard {@code s3://bucket/key} format. Other formats like path-style | ||
| * ({@code https://s3.amazonaws.com/bucket/key}) or virtual-hosted-style ({@code | ||
| * https://bucket.s3.amazonaws.com/key}) are not currently supported. |
There was a problem hiding this comment.
Now we're dropping the format expectation and we don't have any enforcement in code too. Maybe we should add and blow up early.
There was a problem hiding this comment.
Though I guess requireSupportedScheme will catch these.
| } | ||
|
|
||
| @ParameterizedTest | ||
| @CsvSource({"file:///tmp/foo", "hdfs://bucket/key", "gs://bucket/key"}) |
There was a problem hiding this comment.
Should we also have no schema option test?
| @ParameterizedTest | ||
| @CsvSource({ | ||
| "s3://bucket", | ||
| "s3://bucket/", |
There was a problem hiding this comment.
what would happen for s3://bucket//?
Izeren
left a comment
There was a problem hiding this comment.
Thank you @Samrat002, LGTM assuming that CI is green and feedback about indexof checks is addressed
|
@flinkbot run azure |
51e8f99 to
760bacd
Compare
|
CI is failing due to https://issues.apache.org/jira/browse/FLINK-40635. |
|
Is this flaky? We're not in a rush |
|
@flinkbot run azure |
1 similar comment
|
@flinkbot run azure |
There was a problem hiding this comment.
My AI says (with slight amendments from me) :
-
Behaviour change on extractKey(Path) — now throws instead of silently accepting
I suggest this is a change in behaviour - I suggest calling this out in the release notes on back ports. -
extractBucket(String) vs extractBucketName(Path) — naming inconsistency
The two string-based methods are extractBucket(String) and extractKey(String). The two Path-based methods are extractBucketName(Path) and extractKey(Path). The inconsistency (extractBucket vs extractBucketName) is a small but unnecessary cognitive bump. extractBucketName is arguably more explicit, but consistency across overloads would be cleaner. This was noted by a reviewer as a nit. -
extractKey(String) with s3://bucket/ returns "" but test case says it should
Looking at testExtractKeyReturnsEmptyForBucketOnly:
"s3://bucket/", // expects empty
In requireSupportedScheme, s3://bucket/ doesn't start with s3a://, so stays as-is. S3.length() = 5, uri.indexOf('/', 5) finds the / at index 11 (s3://bucket/), so keyStart = 11, returns uri.substring(12) = "".
-
CI is failing — unrelated flaky test (FLINK-40635)
The author confirmed this. Reviewer gaborgsomogyi questioned whether it's flaky; the author re-triggered CI but the failure persists on the latest push. This should be resolved before merge to confirm it's truly unrelated and not masking a real regression. -
Minor: extractKey(String) javadoc is missing
extractBucket(String) has a Javadoc with @throws. extractKey(String) has no Javadoc at all, even though it can also throw IllegalArgumentException for unsupported schemes. Inconsistent documentation.
760bacd to
7f57fde
Compare
|
Thank you @davidradl. Please find the inline reply
native-s3-fs has been released as experimental in flink-2.3. Since then, there have been huge changes it has gone through. The entry-point classes
I have made changes to address the concern and renamed the method to
Test behaviour is as expected. I think AI was confused by the lack of docs. Fixed it now
Thanks for pointing it out. Added minimal Javadoc |
7f57fde to
78b073c
Compare
What is the purpose of the change
Add S3URIUtils and remove duplicated helpers.
Brief change log
Introduce S3URIUtils.
Verifying this change
Does this pull request potentially affect one of the following parts:
@Public(Evolving): (yes / no) noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: [Tool Name and Version]