prashantwason commented on code in PR #20356:
URL: https://github.com/apache/hudi/pull/20356#discussion_r4290211559


##########
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:
   Done in 6bea43dbaf66: both tests now call `convertSchema(input)` once and 
reuse the result.



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