Skip to content

Commit 8afb44d

Browse files
authored
Merge pull request #70 from linkedin/avro-upgrade-draft
fix compatibility issues for avro 1.9.2 upgrade
2 parents 270600d + 92f3bf3 commit 8afb44d

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
// See LICENSE in the project root for license information.
44

55
buildscript {
6-
ext.avroVersion = '1.8.1'
6+
ext.avroVersion = '1.9.2'
77
ext.awsVersion = '2.10.15'
88
ext.findBugsVersion = '3.0.0'
9-
ext.gobblinVersion = '0.17.0-dev-174'
9+
ext.gobblinVersion = '0.17.0-dev-303'
1010
ext.hadoopVersion = '2.3.0'
1111
ext.hiveVersion = '1.0.1'
1212
ext.javaVersion = JavaVersion.VERSION_1_8

cdi-core/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jacocoTestReport {
4242
apply from: "$rootDir/gradle/java-publishing.gradle"
4343

4444
dependencies {
45+
compile externalDependency.'avro'
4546
compile externalDependency.'gson'
4647
compile externalDependency.'gobblin-core'
4748
compile externalDependency.'gobblin-core-base'

cdi-core/src/main/java/com/linkedin/cdi/util/AvroSchemaUtils.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ static List<String> getSchemaFieldNames(Schema schema) {
5252
* @return copy of schema field
5353
*/
5454
static Schema.Field deepCopySchemaField(Schema.Field field) {
55-
Schema.Field f = new Schema.Field(field.name(), field.schema(), field.doc(), field.defaultVal(), field.order());
56-
field.getProps().forEach(f::addProp);
57-
return f;
55+
Schema.Field f = new Schema.Field(field.name(), field.schema(), field.doc(), field.defaultVal(), field.order());
56+
field.getObjectProps().forEach(
57+
(propName, propValue) -> {
58+
if (propValue instanceof String) f.addProp(propName, (String) propValue);
59+
}
60+
);
61+
return f;
5862
}
5963

6064
/**

0 commit comments

Comments
 (0)