You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Jordano-Dremio (via GitHub)" <gi...@apache.org> on 2025/04/03 19:41:18 UTC
[PR] Use InputFile.location() Instead of Direct Object Reference in Error Messages [iceberg]
Jordano-Dremio opened a new pull request, #12716:
URL: https://github.com/apache/iceberg/pull/12716
The InputFile Interface/Object is often used directly in error messages. [Example](https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/avro/AvroIterable.java#L104).
In order for the error message to print the path of the InputFile, each implementation must have a toString() method overridden with .location().
However, if the Implementation does not override the toString, the result is:
`Failed to open file: com.dremio.exec.store.iceberg.RandomInputFileImplementation@5e3d9f12`
instead of leaving it up to the implementation to properly override the toString() method, it would be best to print the InputFile.location(). There are many [examples](https://github.com/apache/iceberg/blob/main/orc/src/main/java/org/apache/iceberg/orc/OrcMetrics.java#L101) in the Iceberg Codebase where we already print the .location instead of the Object's reference ID.
Change-Id: Ib81ac94c7c6c110a4108f590ad0ba3149a6a0a05
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Core: Use InputFile.location() Instead of Direct Object Reference in Error Messages [iceberg]
Posted by "Jordano-Dremio (via GitHub)" <gi...@apache.org>.
Jordano-Dremio closed pull request #12716: Core: Use InputFile.location() Instead of Direct Object Reference in Error Messages
URL: https://github.com/apache/iceberg/pull/12716
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Core: Use InputFile.location() Instead of Direct Object Reference in Error Messages [iceberg]
Posted by "ajantha-bhat (via GitHub)" <gi...@apache.org>.
ajantha-bhat commented on code in PR #12716:
URL: https://github.com/apache/iceberg/pull/12716#discussion_r2029317787
##########
core/src/main/java/org/apache/iceberg/view/ViewMetadataParser.java:
##########
@@ -175,7 +175,8 @@ public static ViewMetadata read(InputFile file) {
codec == Codec.GZIP ? new GZIPInputStream(file.newStream()) : file.newStream()) {
return fromJson(file.location(), JsonUtil.mapper().readValue(is, JsonNode.class));
} catch (IOException e) {
- throw new UncheckedIOException(String.format("Failed to read json file: %s", file), e);
+ throw new UncheckedIOException(
+ String.format("Failed to read json file: %s", file.location()), e);
Review Comment:
I would like to handle the same for `OutputFile` also. Maybe you can do it in a follow up PR.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Core: Use InputFile.location() Instead of Direct Object Reference in Error Messages [iceberg]
Posted by "Jordano-Dremio (via GitHub)" <gi...@apache.org>.
Jordano-Dremio commented on PR #12716:
URL: https://github.com/apache/iceberg/pull/12716#issuecomment-2791211643
@nastra , as mentioned on the OutputFile PR (https://github.com/apache/iceberg/pull/12755) It appeared that my local was disconnected from my remote iceberg repository. Everything should be in sync now. This PR is ready for review.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Core: Use InputFile.location() Instead of Direct Object Reference in Error Messages [iceberg]
Posted by "Jordano-Dremio (via GitHub)" <gi...@apache.org>.
Jordano-Dremio commented on PR #12716:
URL: https://github.com/apache/iceberg/pull/12716#issuecomment-2794020154
Closing this pull request because these changes have been merged with https://github.com/apache/iceberg/pull/12755
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Core: Use InputFile.location() Instead of Direct Object Reference in Error Messages [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on PR #12716:
URL: https://github.com/apache/iceberg/pull/12716#issuecomment-2782095501
I did a quick scan over the codebase and it seems that there are more places like this one, so it would be good to update those as well
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Core: Use InputFile.location() Instead of Direct Object Reference in Error Messages [iceberg]
Posted by "Jordano-Dremio (via GitHub)" <gi...@apache.org>.
Jordano-Dremio commented on code in PR #12716:
URL: https://github.com/apache/iceberg/pull/12716#discussion_r2029404043
##########
core/src/main/java/org/apache/iceberg/view/ViewMetadataParser.java:
##########
@@ -175,7 +175,8 @@ public static ViewMetadata read(InputFile file) {
codec == Codec.GZIP ? new GZIPInputStream(file.newStream()) : file.newStream()) {
return fromJson(file.location(), JsonUtil.mapper().readValue(is, JsonNode.class));
} catch (IOException e) {
- throw new UncheckedIOException(String.format("Failed to read json file: %s", file), e);
+ throw new UncheckedIOException(
+ String.format("Failed to read json file: %s", file.location()), e);
Review Comment:
Sure. Lets do a Follow up PR. Thanks
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org