findepi commented on code in PR #5802:
URL: https://github.com/apache/iceberg/pull/5802#discussion_r975041865
##########
core/src/main/java/org/apache/iceberg/PartitionSpecParser.java:
##########
@@ -66,19 +65,7 @@ public static String toJson(UnboundPartitionSpec spec) {
}
public static String toJson(UnboundPartitionSpec spec, boolean pretty) {
- try {
- StringWriter writer = new StringWriter();
- JsonGenerator generator = JsonUtil.factory().createGenerator(writer);
- if (pretty) {
- generator.useDefaultPrettyPrinter();
- }
- toJson(spec, generator);
- generator.flush();
- return writer.toString();
-
- } catch (IOException e) {
- throw new RuntimeIOException(e);
- }
+ return JsonUtil.generate(gen -> toJson(spec, gen), pretty);
Review Comment:
> i'd use `generator` instead of `gen`.
i see now both are used in the codebase. disregard
--
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]