Skip to content

Commit

Permalink
Merge pull request #14 from arenadata/pxf-5.x-avro-bump
Browse files Browse the repository at this point in the history
Pxf 5.x avro bump
  • Loading branch information
deart2k authored Dec 15, 2021
2 parents ec52c5b + a15082a commit f54a88f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
9 changes: 6 additions & 3 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ allprojects {

repositories {
mavenCentral()
maven {
url "http://conjars.org/repo"
}
}

group = 'org.greenplum.pxf'
Expand Down Expand Up @@ -75,7 +78,7 @@ allprojects {
force "commons-codec:commons-codec:1.4"
force "commons-collections:commons-collections:3.2.1"
force "commons-logging:commons-logging:1.1.3"
force "org.apache.avro:avro:1.7.7"
force "org.apache.avro:avro:1.9.2"
force "org.apache.zookeeper:zookeeper:3.4.6"
force "junit:junit:${junitVersion}"
force "com.google.guava:guava:19.0"
Expand Down Expand Up @@ -164,7 +167,7 @@ project('pxf-hbase') {
project('pxf-hdfs') {
dependencies {
compile(project(':pxf-api'))
compile "org.apache.avro:avro-mapred:1.7.7"
compile "org.apache.avro:avro-mapred:1.9.2"
compile "com.fasterxml.jackson.core:jackson-databind:2.11.0"
compile "com.fasterxml.jackson.core:jackson-core:2.11.0"
compile "com.fasterxml.jackson.core:jackson-annotations:2.11.0"
Expand All @@ -187,7 +190,7 @@ project('pxf-hdfs') {
// for parquet tests
testCompile "org.apache.parquet:parquet-pig:${parquetVersion}"

bundleJars "org.apache.avro:avro:1.7.7"
bundleJars "org.apache.avro:avro:1.9.2"
// Dependency in hadoop 2.9.2
bundleJars "com.fasterxml.woodstox:woodstox-core:5.0.3"
bundleJars "org.codehaus.woodstox:stax2-api:3.1.4"
Expand Down
2 changes: 1 addition & 1 deletion server/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ version=0.0.0-SNAPSHOT
license=ASL 2.0
hadoopVersion=2.9.2
htraceVersion=4.0.1-incubating
hiveVersion=2.3.7
hiveVersion=2.3.8
hbaseVersion=1.3.2
junitVersion=4.11
tomcatVersion=7.0.105
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ private Schema getAvroSchemaForComplexTypes() {
// add a RECORD with a float, int, and string inside
fields.add(new Schema.Field(
Schema.Type.RECORD.getName(),
createRecord(new Schema.Type[]{Schema.Type.FLOAT, Schema.Type.INT, Schema.Type.STRING}),
createRecord(schema, new Schema.Type[]{Schema.Type.FLOAT, Schema.Type.INT, Schema.Type.STRING}),
"",
null)
);
Expand Down Expand Up @@ -369,12 +369,12 @@ private Schema createEnum(String name, String[] symbols) {
return Schema.createEnum("enum", "", null, values);
}

private Schema createRecord(Schema.Type[] types) {
private Schema createRecord(Schema schema, Schema.Type[] types) {
List<Schema.Field> fields = new ArrayList<>();
for (Schema.Type type : types) {
fields.add(new Schema.Field(type.getName(), Schema.create(type), "", null));
}
return Schema.createRecord(fields);
return Schema.createRecord(schema.getName(), schema.getDoc(), schema.getNamespace(), false, fields);
}

// we can only support Unions that have 2 elements, and one has to be NULL
Expand Down

0 comments on commit f54a88f

Please sign in to comment.