thswlsqls opened a new pull request, #17098:
URL: https://github.com/apache/iceberg/pull/17098

   Closes #17097
   
   ## Summary
   
   - `OrcToIcebergVisitor.primitive()` built the exception for an invalid 
`iceberg.timestamp-unit` attribute with `"Invalid Timestamp type unit: %s" + 
unit` (string concatenation) instead of `String.format`, so `%s` was never 
substituted and stayed in the message, e.g. `Invalid Timestamp type unit: 
%sSECONDS`.
   - Both the `TIMESTAMP` and `TIMESTAMP_INSTANT` branches had the same bug; 
this fixes both.
   - Matches the sibling pattern in `GenericOrcReader.java`, which already uses 
`String.format("Invalid iceberg type %s corresponding to ORC type %s", ...)` 
for a similar invalid-type exception.
   
   ## Testing done
   
   - Added `TestORCSchemaUtil#testInvalidTimestampUnit` and 
`#testInvalidTimestampInstantUnit`, each asserting `IllegalStateException` with 
the correctly substituted message when `iceberg.timestamp-unit` is set to an 
unsupported value.
   - `./gradlew :iceberg-orc:check` — 10 tests passed (TestORCSchemaUtil), 
including the 2 new tests.
   - `./gradlew :iceberg-orc:revapi` — passed as part of `:iceberg-orc:check` 
(package-private class, no public API impact).
   
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to