nastra commented on code in PR #17010:
URL: https://github.com/apache/iceberg/pull/17010#discussion_r3500511542
##########
api/src/test/java/org/apache/iceberg/types/TestTypeUtil.java:
##########
@@ -970,4 +970,69 @@ public void ancestorFieldsInNestedSchema() {
assertThat(TypeUtil.ancestorFields(schema,
16)).containsExactly(pointsElement, points);
assertThat(TypeUtil.ancestorFields(schema,
17)).containsExactly(pointsElement, points);
}
+
+ @Test
+ public void testIndexStatsNames() {
+ Schema schema =
+ new Schema(
+ required(1, "id", Types.LongType.get()),
+ optional(2, "data", Types.StringType.get()),
+ optional(
+ 3,
+ "location",
+ Types.StructType.of(
+ required(10, "lat", Types.FloatType.get()),
+ required(11, "long", Types.FloatType.get()))),
+ optional(4, "values", Types.ListType.ofOptional(12,
IntegerType.get())),
+ optional(
+ 5,
+ "points",
+ Types.ListType.ofRequired(
+ 13,
+ Types.StructType.of(
+ required(14, "x", IntegerType.get()),
+ required(15, "y", IntegerType.get())))),
+ optional(
+ 6,
+ "properties",
+ Types.MapType.ofOptional(16, 17, Types.StringType.get(),
Types.StringType.get())),
+ optional(
+ 7,
+ "addresses",
+ Types.MapType.ofRequired(
+ 18,
+ 19,
+ Types.StringType.get(),
+ Types.StructType.of(
+ required(20, "street", Types.StringType.get()),
+ optional(21, "city", Types.StringType.get()),
+ optional(22, "state", Types.StringType.get()),
+ required(23, "zip", Types.IntegerType.get())))));
Review Comment:
the intent was to explicitly show what the end result would be when an
actual field name with ID x would be the same as another shortened field name
with ID y. While reviewing this immediately came to my mind and so I thought it
would be good to explicitly add such a case
--
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]