Description
test.json has:
{ "name": "arrayString", "type":
},
bin/gora compile test.json .
Exception in thread "main" org.apache.avro.AvroRuntimeException: Not a map:
at org.apache.avro.Schema.getValueType(Schema.java:274)
at org.apache.gora.compiler.GoraCompiler.compile(GoraCompiler.java:327)
at org.apache.gora.compiler.GoraCompiler.compile(GoraCompiler.java:123)
at org.apache.gora.compiler.GoraCompiler.compileSchema(GoraCompiler.java:63)
at org.apache.gora.compiler.GoraCompiler.main(GoraCompiler.java:448)
Here is the patch to fix this issue:
diff --git gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java
index cf0ca83..ec1e53d 100644
— gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java
+++ gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java
@@ -324,7 +324,7 @@ public class GoraCompiler {
break;
case ARRAY:
unboxed = unbox(fieldSchema.getElementType());
- fieldType = type(fieldSchema.getValueType());
+ fieldType = type(fieldSchema.getElementType());
line(1, "public GenericArray<"fieldType"> get"camelKey"() {"); line(2, "return (GenericArray<"+fieldType+">) get("+i+");"); line(1, "}");