Matthew-DWM opened a new pull request, #9634:
URL: https://github.com/apache/texera/pull/9634

   ### What changes were proposed in this PR?
   
   The JVM `LargeBinary` constructor only checked for null and the `s3://` 
prefix, so `s3://bucket`, `s3://bucket/` and `s3:///object` were accepted and 
failed later at S3 (or, once #9626 lands, in the next Python operator). It now 
parses the URI with `java.net.URI`, reading the bucket and key as the getters 
do, and throws `IllegalArgumentException` naming the URI when either is empty. 
As in #9626, all leading slashes are stripped first, so `s3://bucket//` and 
`s3://bucket/?versionId=1` are rejected too.
   
   ```
   Before:  new LargeBinary("s3://bucket") -> accepted, key ""  -> fails later 
inside S3
   After:   new LargeBinary("s3://bucket") -> IllegalArgumentException: 
LargeBinary URI must include a bucket and object key, got: s3://bucket
   ```
   
   Behavior changes:
   - A keyless URI now fails where it is parsed into a `LARGE_BINARY` field, 
read back from Iceberg or deserialized. URIs minted by `new LargeBinary()` 
always have a key.
   - A URI `java.net.URI` cannot parse, including a bare `s3://` on JDK 17, 
gets `LargeBinary URI is not a valid URI, got: ...` with the parse error as the 
cause.
   - A bucket name with `_` is rejected: `java.net.URI` reads no host from it, 
so the getters already returned `null`, and S3 bucket names can't contain `_`.
   
   ### Any related issues, documentation, discussions?
   
   Closes #9625. JVM side of #9626 (for #8279).
   
   ### How was this PR tested?
   
   In `LargeBinarySpec`, the case that pinned `s3://bucket-only` as accepted 
now expects rejection. New tests check the exact messages for six incomplete 
URIs and two unparseable ones, a keyless JSON payload, and that keys ending in 
`/` or holding non-ASCII characters are still accepted. The new tests were 
written before the fix and all pass with it; 3 of them fail on main with 
`Expected exception ... but no exception was thrown`.
   
   With JDK 17 and Docker running, using CI's commands:
   
   ```text
   sbt "WorkflowCore/testOnly 
org.apache.texera.amber.core.tuple.LargeBinarySpec"
   15 passed
   
   sbt scalafmtCheckAll "scalafixAll --check"
   sbt WorkflowCore/jacoco WorkflowOperator/jacoco WorkflowCompiler/jacoco 
WorkflowExecutionService/jacoco
   888, 3014, 87 and 2433 passed, with AMBER_TEST_FILTER=skip-integration
   
   sbt WorkflowOperator/test WorkflowExecutionService/test
   85 and 47 passed, with AMBER_TEST_FILTER=integration-only
   ```
   
   The service modules built on `workflow-core` pass too, and 
`WorkflowCore/jacoco` covers every changed line and branch.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

  • [PR] feat(workflow-core... Matthew-DWM (via GitHub) via notifications

Reply via email to