You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by "umustafi (via GitHub)" <gi...@apache.org> on 2023/02/01 23:47:14 UTC

[GitHub] [gobblin] umustafi commented on a diff in pull request #3632: [GOBBLIN-1774] Util for detecting non optional unions Hive tables

umustafi commented on code in PR #3632:
URL: https://github.com/apache/gobblin/pull/3632#discussion_r1093855867


##########
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:
   in the function above it looks like its looking for a `uniontype` column name and that's not here although i do see `aUnionField` has multiple options for type.



-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org