This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/master by this push:
     new 8a8508de70 Core: Make `TableMetadataParser.fromJson` taking `JsonNode` 
public (#7032)
8a8508de70 is described below

commit 8a8508de70f54335e5f551ff39e5954da7274b5c
Author: Robert Stupp <[email protected]>
AuthorDate: Thu Jun 29 15:28:31 2023 +0200

    Core: Make `TableMetadataParser.fromJson` taking `JsonNode` public (#7032)
    
    In the WIP for the Nessie Iceberg REST catalog server, there are a few 
places that currently require us to first serialize a `TableMetadata` to a 
`String` just to parse it right back into a `TableMetadata`, but this time with 
the right metadata-location.
    
    First occurence is when we write the table metadata, where we have to first 
store the table metadata, get the metadata location, and then return the table 
metadata with the metadata location (and updates cleared).
    Second occurence is when we return a table metadata with "transient 
properties", which are used to pass the "expected Nessie commit" around.
    
    This change makes the two `TableMetadataParser.fromJson()` taking a 
`JsonNode` public
---
 core/src/main/java/org/apache/iceberg/TableMetadataParser.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/iceberg/TableMetadataParser.java 
b/core/src/main/java/org/apache/iceberg/TableMetadataParser.java
index dc234c32ae..601aff5516 100644
--- a/core/src/main/java/org/apache/iceberg/TableMetadataParser.java
+++ b/core/src/main/java/org/apache/iceberg/TableMetadataParser.java
@@ -299,7 +299,7 @@ public class TableMetadataParser {
     return JsonUtil.parse(json, node -> 
TableMetadataParser.fromJson(metadataLocation, node));
   }
 
-  static TableMetadata fromJson(InputFile file, JsonNode node) {
+  public static TableMetadata fromJson(InputFile file, JsonNode node) {
     return fromJson(file.location(), node);
   }
 
@@ -308,7 +308,7 @@ public class TableMetadataParser {
   }
 
   @SuppressWarnings({"checkstyle:CyclomaticComplexity", 
"checkstyle:MethodLength"})
-  static TableMetadata fromJson(String metadataLocation, JsonNode node) {
+  public static TableMetadata fromJson(String metadataLocation, JsonNode node) 
{
     Preconditions.checkArgument(
         node.isObject(), "Cannot parse metadata from a non-object: %s", node);
 

Reply via email to