Repository: incubator-gobblin
Updated Branches:
  refs/heads/master ee770f5c5 -> a871e5c5d


[GOBBLIN-300] Use 1.7.7 form of Schema.createUnion() API that takes in a list

Closes #2155 from htran1/avro_union_fix


Project: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/commit/a871e5c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/tree/a871e5c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/diff/a871e5c5

Branch: refs/heads/master
Commit: a871e5c5d6f539bcfbcc4e2850685c58dd72dd1a
Parents: ee770f5
Author: Hung Tran <[email protected]>
Authored: Mon Oct 30 17:39:19 2017 -0700
Committer: Hung Tran <[email protected]>
Committed: Mon Oct 30 17:39:19 2017 -0700

----------------------------------------------------------------------
 .../gobblin/converter/avro/JsonElementConversionFactory.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-gobblin/blob/a871e5c5/gobblin-core/src/main/java/org/apache/gobblin/converter/avro/JsonElementConversionFactory.java
----------------------------------------------------------------------
diff --git 
a/gobblin-core/src/main/java/org/apache/gobblin/converter/avro/JsonElementConversionFactory.java
 
b/gobblin-core/src/main/java/org/apache/gobblin/converter/avro/JsonElementConversionFactory.java
index 07e1fc5..dba68a5 100644
--- 
a/gobblin-core/src/main/java/org/apache/gobblin/converter/avro/JsonElementConversionFactory.java
+++ 
b/gobblin-core/src/main/java/org/apache/gobblin/converter/avro/JsonElementConversionFactory.java
@@ -305,7 +305,7 @@ public class JsonElementConversionFactory {
 
     protected Schema buildUnionIfNullable(Schema schema) {
       if (this.isNullable()) {
-        return Schema.createUnion(Schema.create(Schema.Type.NULL), schema);
+        return 
Schema.createUnion(Arrays.asList(Schema.create(Schema.Type.NULL), schema));
       }
       return schema;
     }
@@ -756,7 +756,7 @@ public class JsonElementConversionFactory {
 
     @Override
     protected Schema schema() {
-      return Schema.createUnion(firstSchema, secondSchema);
+      return Schema.createUnion(Arrays.asList(firstSchema, secondSchema));
     }
   }
 }

Reply via email to