[
https://issues.apache.org/jira/browse/GOBBLIN-1774?focusedWorklogId=843035&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-843035
]
ASF GitHub Bot logged work on GOBBLIN-1774:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 01/Feb/23 23:58
Start Date: 01/Feb/23 23:58
Worklog Time Spent: 10m
Work Description: homatthew commented on code in PR #3632:
URL: https://github.com/apache/gobblin/pull/3632#discussion_r1093863228
##########
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:
non optional uniontypes in avro are represented as a ["type1", "type2", ...]
where the first type is the default. See
https://avro.apache.org/docs/1.10.2/spec.html#Unions
Issue Time Tracking
-------------------
Worklog Id: (was: 843035)
Time Spent: 40m (was: 0.5h)
> Add utility method for GMIP, MR compaction, and Incremental to skip override
> hive schema on topics with complex union
> ---------------------------------------------------------------------------------------------------------------------
>
> Key: GOBBLIN-1774
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1774
> Project: Apache Gobblin
> Issue Type: Improvement
> Reporter: Matthew Ho
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)