wombatu-kun commented on code in PR #16604:
URL: https://github.com/apache/iceberg/pull/16604#discussion_r3994490970


##########
kafka-connect/kafka-connect-transforms/src/test/java/org/debezium/connector/mongodb/transforms/TestMongoArrayConverter.java:
##########
@@ -389,4 +395,60 @@ public void 
shouldCreateStructForHeterogenousDocumentInArray() throws Exception
             "Struct{" + "_id=1," + "a1=Struct{" + "_0=Struct{a=1}," + 
"_1=Struct{a=c}" + "}" + "}");
     // @formatter:on
   }
+
+  @Test
+  @SuppressWarnings("JavaUtilDate")
+  public void shouldConvertArrayOfTimestamps() {
+    final MongoDataConverter converter = new 
MongoDataConverter(ArrayEncoding.ARRAY);
+    final BsonDocument val =
+        new BsonDocument()
+            .append("_id", new BsonInt32(1))
+            .append(
+                "ts",
+                new BsonArray(Arrays.asList(new BsonTimestamp(60, 1), new 
BsonTimestamp(120, 1))));
+
+    final SchemaBuilder schemaBuilder = SchemaBuilder.struct().name("array");
+    for (Entry<String, BsonValue> entry : val.entrySet()) {
+      converter.addFieldSchema(entry, schemaBuilder);
+    }
+    final Schema finalSchema = schemaBuilder.build();
+    final Struct struct = new Struct(finalSchema);
+    for (Entry<String, BsonValue> entry : val.entrySet()) {
+      converter.convertRecord(entry, finalSchema, struct);
+    }
+
+    // BsonTimestamp.getTime() returns the seconds component; the scalar path 
multiplies by 1000
+    List<?> tsValues = (List<?>) struct.get("ts");

Review Comment:
   Done d205dfa0e5d1. Used `asInstanceOf(InstanceOfAssertFactories.LIST)` 
instead of `asList()`, which is `@Deprecated` in AssertJ 3.27.7 and delegates 
to exactly that call.



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