2017-08-02 54 views
0

仿製藥轉換爲Avro的模式我用下面的註解,但我得到之後org.apache.avro.SchemaParseException:未定義的名稱:

public class Test2<T> 
    { 
@AvroSchema("{\"type\":\"array\",\"items\":[\"null\",\"Test4\"]}") 
    private Set<T> test4; 
} 

public class Test4 { 

    public Integer getX() { 
     return x; 
    } 

    public void setX(Integer x) { 
     this.x = x; 
    } 

    public Test4(Integer x) { 

     this.x = x; 
    } 

    public Test4() { 

    } 

    private Integer x; 
} 

我來到這裏的錯誤的例外是 org.apache .avro.SchemaParseException:未定義的名稱:TEST4

回答

0

這件事的工作

@AvroSchema("{\"type\":\"array\",\"items\":{\"name\":\"Child\",\"type\":\"record\",\"fields\":[{\"name\":\"x\",\"type\":\"int\"}]}}") 

感謝BTW。