homatthew commented on code in PR #3632:
URL: https://github.com/apache/gobblin/pull/3632#discussion_r1093863646
##########
gobblin-hive-registration/src/test/java/org/apache/gobblin/hive/metastore/HiveMetaStoreUtilsTest.java:
##########
@@ -212,4 +217,84 @@ public void testGetHiveTable() throws Exception {
Assert.assertEquals(fieldA.getType(), "int");
}
+
+ @Test
+ public void testContainsUnionType_AvroSucceeds() {
+ final String databaseName = "db";
+ final String tableName = "tbl";
+ final State serdeProps = new State();
+
+ serdeProps.setProp("avro.schema.literal", "{\"type\": \"record\",
\"name\": \"TestEvent\","
+ + " \"namespace\": \"test.namespace\", \"fields\":
[{\"name\":\"aUnionField\", \"type\": [\"string\", \"int\"]}]}");
+ HiveTable hiveTable = createTestHiveTable_Avro(databaseName, tableName,
serdeProps);
+
+ Assert.assertTrue(HiveMetaStoreUtils.containsUnionTypeColumn(hiveTable));
Review Comment:
And so when we register a table with this schema to hive, the column type
will contain "uniontype". Hence why this test passes.
--
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]