dramaticlly commented on code in PR #18342:
URL: https://github.com/apache/iceberg/pull/18342#discussion_r4161532198
##########
api/src/test/java/org/apache/iceberg/util/TestStructProjection.java:
##########
@@ -69,4 +69,22 @@ void
createStillThrowsForMissingOptionalFieldInNestedStruct() {
.isInstanceOf(IllegalArgumentException.class)
.hasMessageStartingWith("Cannot find field");
}
+
+ @Test
+ void toStringRendersNestedProjectionRecursively() {
+ StructProjection projection = StructProjection.create(PROJECTED_STRUCT,
PROJECTED_STRUCT);
+ projection.wrap(Row.of(1L, Row.of("John", "Q", "Doe")));
+
+ assertThat(projection)
+ .hasToString(
+ "StructProjection{id=1, person=StructProjection{first=John,
middle=Q, last=Doe}}");
+ }
+
+ @Test
+ void toStringRendersNullNestedStructAsNull() {
Review Comment:
nit: would be great to have coverage on
`StructProjection.createAllowMissing(DATA_STRUCT_MISSING_NESTED_FIELD,
PROJECTED_STRUCT)` as well.
--
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]