You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that circular schema references (see example below) are supported for avsc schemas, however I was not able to get them working in avdl schemas; they will error when compiled to avsc schemas with the usual 'undefined type name' error, as the declaration order of records in avdl matters.
// this will not compile with avsc
record SampleNode {
int count = 0;
array<SamplePair> samples = [];
}
record SamplePair {
string name;
SampleNode node;
}
Judging from avro's issue tracker, support for circular references landed in v1.9 (source) - is there any way in avsc lib that supports circular references in avdl today or would avsc need to upgrade to avro v1.9 specification?
Hi @MichaelHirn. Thanks for bringing this up, I wasn't aware of this v1.9 change. avsc does not currently support this type of IDL but probably should. How urgent is this feature from your side?
In case it's useful: avsc already supports IDL files with circular references using the following (non-standard now, since it predates the v1.9 change and was modeled on .avsc declarations) syntax:
record SampleNode {
int count = 0;
array < record SamplePair { // "Inline declaration".
string name;
SampleNode node;
} > samples = [];
}
(You can even omit the < and > delimiters, as they tend to clutter definitions.)
Hi @mtth, thanks for your response. The inline declaration is very helpful - I think that would probably be sufficient for us for now. I will be able to use inline declaration (and circular dependencies) more in the next days and weeks and would circle back with any updates.
I understand that circular schema references (see example below) are supported for avsc schemas, however I was not able to get them working in avdl schemas; they will error when compiled to avsc schemas with the usual 'undefined type name' error, as the declaration order of records in avdl matters.
Judging from avro's issue tracker, support for circular references landed in v1.9 (source) - is there any way in
avsc
lib that supports circular references in avdl today or wouldavsc
need to upgrade to avro v1.9 specification?ref: #238
The text was updated successfully, but these errors were encountered: