You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Juliet Hougland <ju...@wibidata.com> on 2013/06/11 01:56:06 UTC
Error parsing an 'array' in an avdl file
Hi Avro-ers,
I have an avdl file that I am getting the following parse error in:"
org.apache.avro.compiler.idl.ParseException: Encountered " "record"
"record "" at line <Pointer to the line of the first record after
'AndFilter' record def>." The relevant section of my avdl file looks like:
record ColumnRangeFilter {
/** The minimum qualifier bound. null means none.*/
union{null, string} min_qualifier;
/** Whether to include the lower bound. */
boolean min_included;
/** The maximum qualifier bound. null means none.*/
union{null, string} max_qualifier;
/** Whether to include the upper bound. */
boolean max_included;
}
/**
* Specification of a RegexQualifierFilter.
*/
record RegexQualifierFilter {
/** The regular expression for qualifiers that should be
* accepted by this filter. The expression is matched against the
full qualifier (as
* if it implicitly starts with '^' and ends with '$'.
*/
string regex;
}
/**
* Specification of an 'and' filter.
*/
record AndFilter {
/** A List of filters to apply the logical operator to.
array<union{RegexQualifierFilter, ColumnRangeFilter}> filter_list;
}
When I remove the "AndFilter" record declaration from my file, the file is
parsed correctly and all of the classes are generated. Is there a
different/better way to declare an array of union type in an avdl file? My
(hopefully temporary) solution is to make another record with one field
that is of type 'union{RegexQualifierFilter, ColumnRangeFilter}' and use
that to parameterize the array.
Thanks,
Juliet
Re: Error parsing an 'array' in an avdl file
Posted by Juliet Hougland <ju...@wibidata.com>.
Never mind, just fixed the unclosed comment. Arrays of unions work fine in
an avdl file.
Hope I didn't waste anyone's time!
Best,
Juliet
On Mon, Jun 10, 2013 at 4:56 PM, Juliet Hougland <ju...@wibidata.com>wrote:
> Hi Avro-ers,
> I have an avdl file that I am getting the following parse error in:" org.apache.avro.compiler.idl.ParseException: Encountered " "record"
> "record "" at line <Pointer to the line of the first record after
> 'AndFilter' record def>." The relevant section of my avdl file looks like:
>
> record ColumnRangeFilter {
> /** The minimum qualifier bound. null means none.*/
> union{null, string} min_qualifier;
>
> /** Whether to include the lower bound. */
> boolean min_included;
>
> /** The maximum qualifier bound. null means none.*/
> union{null, string} max_qualifier;
>
> /** Whether to include the upper bound. */
> boolean max_included;
> }
>
> /**
> * Specification of a RegexQualifierFilter.
> */
> record RegexQualifierFilter {
> /** The regular expression for qualifiers that should be
> * accepted by this filter. The expression is matched against the
> full qualifier (as
> * if it implicitly starts with '^' and ends with '$'.
> */
> string regex;
> }
>
> /**
> * Specification of an 'and' filter.
> */
> record AndFilter {
> /** A List of filters to apply the logical operator to.
> array<union{RegexQualifierFilter, ColumnRangeFilter}> filter_list;
> }
>
> When I remove the "AndFilter" record declaration from my file, the file
> is parsed correctly and all of the classes are generated. Is there a
> different/better way to declare an array of union type in an avdl file? My
> (hopefully temporary) solution is to make another record with one field
> that is of type 'union{RegexQualifierFilter, ColumnRangeFilter}' and use
> that to parameterize the array.
> Thanks,
> Juliet
>