hudi-agent commented on code in PR #20356:
URL: https://github.com/apache/hudi/pull/20356#discussion_r4289409098


##########
hudi-gcp/src/test/java/org/apache/hudi/gcp/bigquery/TestBigQuerySchemaResolver.java:
##########
@@ -243,6 +243,40 @@ void convertSchema_maps() {
     Assertions.assertEquals(expected, SCHEMA_RESOLVER.convertSchema(input));
   }
 
+  @Test
+  void convertSchema_nullTypeField() {
+    HoodieSchema input = HoodieSchema.parse("{\"type\": \"record\", \"name\": 
\"testRecord\", \"fields\": ["
+        + "{\"name\": \"name\", \"type\": \"string\"},"
+        + "{\"name\": \"clientpromotion\", \"type\": \"null\", \"default\": 
null},"
+        + "{\"name\": \"age\", \"type\": [\"null\", \"int\"], \"default\": 
null}]}");
+
+    Schema expected = Schema.of(
+        Field.newBuilder("name", 
StandardSQLTypeName.STRING).setMode(Field.Mode.REQUIRED).build(),
+        Field.newBuilder("age", 
StandardSQLTypeName.INT64).setMode(Field.Mode.NULLABLE).build());
+
+    Assertions.assertEquals(expected, SCHEMA_RESOLVER.convertSchema(input));

Review Comment:
   🤖 nit: could you call `convertSchema(input)` once and reuse the result for 
both assertions? It is currently computed twice in each new test.
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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

Reply via email to