ggershinsky commented on a change in pull request #3471:
URL: https://github.com/apache/iceberg/pull/3471#discussion_r803621174



##########
File path: core/src/main/java/org/apache/iceberg/util/JsonUtil.java
##########
@@ -160,6 +167,20 @@ public static void writeLongFieldIf(boolean condition, 
String key, Long value, J
     }
   }
 
+  public static void writeStringIf(boolean condition, String key, String 
value, JsonGenerator generator)
+      throws IOException {
+    if (condition) {
+      generator.writeStringField(key, value);
+    }
+  }
+
+  public static void writeBinaryIf(boolean condition, String key, ByteBuffer 
value, JsonGenerator generator)
+      throws IOException {
+    if (condition) {
+      generator.writeStringField(key, 
StandardCharsets.UTF_8.decode(value).toString());

Review comment:
       we're probably better off with Base64 encoding here




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