You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/11/21 23:19:48 UTC
[GitHub] [iceberg] rdblue commented on a change in pull request #3592: Core: Add methods to parse TableMetadata from JSON strings
rdblue commented on a change in pull request #3592:
URL: https://github.com/apache/iceberg/pull/3592#discussion_r753870270
##########
File path: core/src/main/java/org/apache/iceberg/TableMetadataParser.java
##########
@@ -253,8 +254,42 @@ public static TableMetadata read(FileIO io, InputFile file) {
}
}
- @SuppressWarnings("checkstyle:CyclomaticComplexity")
+ /**
+ * Read TableMetadata from a JSON string.
+ * <p>
+ * The TableMetadata's metadata file location will be unset.
+ *
+ * @param io a FileIO used by {@link Snapshot} instances
+ * @param json a JSON string of table metadata
+ * @return a TableMetadata object
+ */
+ public static TableMetadata fromJson(FileIO io, String json) {
Review comment:
You can pass `null` for `FileIO` in those cases. It isn't used unless you call methods on `Snapshot` that need to open files, like `addedFiles`. To fix that, I think we want to gracefully handle missing `FileIO` in `Snapshot`, but that's a separate 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