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

[GitHub] [gobblin] homatthew commented on a diff in pull request #3632: [GOBBLIN-1774] Util for detecting non optional uniontype columns based on Hive Table metadata

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


##########
gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/metastore/HiveMetaStoreUtils.java:
##########
@@ -261,27 +259,69 @@ public static SerDeInfo getSerDeInfo(HiveRegistrationUnit unit) {
     return si;
   }
 
+  public static boolean containsNonOptionalUnionTypeColumn(Table t) {
+    return containsNonOptionalUnionTypeColumn(getHiveTable(t));
+  }
+
   /**
-   * Util for detecting if {@param hiveTable} has a non-optional union (aka complex unions) column types. A non optional
-   * union is defined as a uniontype with multiple possible types and none of them are null
+   * Util for detecting if a hive table has a non-optional union (aka complex unions) column types. A non optional
+   * union is defined as a uniontype with n >= 2 non-null subtypes
    *
-   * @param hiveTable
-   * @return if hive table contains complex uniontype columns
+   * @param hiveTable Hive table
+   * @return if hive table contains non-optional uniontype columns
    */
   public static boolean containsNonOptionalUnionTypeColumn(HiveTable hiveTable) {
-    if (!isAvroFormat(hiveTable)) {
-      // All values in ORC are optional / nullable
-      return false;
+    if (hiveTable.getProps().contains("avro.schema.literal")) {

Review Comment:
   This case is true for all tables written and managed by Gobblin



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