rdblue commented on code in PR #11831:
URL: https://github.com/apache/iceberg/pull/11831#discussion_r1942090932
##########
core/src/main/java/org/apache/iceberg/SchemaParser.java:
##########
@@ -145,6 +145,8 @@ static void toJson(Type.PrimitiveType primitive,
JsonGenerator generator) throws
static void toJson(Type type, JsonGenerator generator) throws IOException {
if (type.isPrimitiveType()) {
toJson(type.asPrimitiveType(), generator);
+ } else if (type.isVariantType()) {
+ generator.writeString(type.toString());
Review Comment:
Minor: I'd probably just inline the `toJson` call from the previous case
along with this:
```java
if (type.isPrimitiveType() || type.isVariantType()) {
generator.writeString(type.toString());
} else {
```
The idea is just to have one case that does the same thing that's easier to
read. The `toJson` call currently used isn't needed and is only used in that
one place. We could also deprecate it but I don't think it matters.
--
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]