Я скачал avro-tools 1.7.6 и 1.6.3
Код: Выделить всё
example.avdl
Код: Выделить всё
/**
* An example protocol in Avro IDL
*/
@namespace("org.apache.avro.test")
protocol Simple {
@aliases(["org.foo.KindOf"])
enum Kind {
FOO,
BAR, // the bar enum value
BAZ
}
fixed MD5(16);
record TestRecord {
@order("ignore")
string name;
@order("descending")
Kind kind;
MD5 hash;
union { MD5, null} @aliases(["hash"]) nullableHash;
array arrayOfLongs;
}
error TestError {
string message;
}
string hello(string greeting);
TestRecord echo(TestRecord `record`);
int add(int arg1, int arg2);
bytes echoBytes(bytes data);
void `error`() throws TestError;
void ping() oneway;
}
Код: Выделить всё
{
"protocol" : "Simple",
"namespace" : "org.apache.avro.test",
"doc" : "* An example protocol in Avro IDL",
"types" : [ {
"type" : "enum",
"name" : "Kind",
"symbols" : [ "FOO", "BAR", "BAZ" ],
"order" : "descending",
"aliases" : [ "org.foo.KindOf" ]
}, {
"type" : "fixed",
"name" : "MD5",
"size" : 16
}, {
"type" : "record",
"name" : "TestRecord",
"fields" : [ {
"name" : "name",
"type" : {
"type" : "string",
"order" : "ignore"
}
}, {
"name" : "kind",
"type" : "Kind"
}, {
"name" : "hash" ...
Код: Выделить всё
java -jar avro-tools-1.6.3.jar idl example.avdl
сгенерированный выше файл схемы недействителен, поскольку у него нет имени , введите и поля в качестве атрибутов верхнего уровня.
Что-то здесь не так?
Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/242 ... rrect-avsc