avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Carey <sc...@richrelevance.com>
Subject Re: questions about sort-orders
Date Thu, 02 Dec 2010 17:54:01 GMT

On Dec 2, 2010, at 8:54 AM, David Jeske wrote:

One other issue I forgot to ask about...  it says:

int, long, float and double data is ordered by ascending numeric value.

This seems really convenient, but how do you plan to achieve this? You might add a comment
about your method.

For example, sorting a long (64bit int) and double (64 bit float) by converting the long to
double will produce invalid sort results for longs which overflow the double bits and truncate.
It seems pulling off this feat would require detecting when the conversion to double will
overflow a double and then convert to an unlimited precision format for the comparison. Is
this what you are doing?


Each is individually sorted, doubles aren't compared to longs.   A field is either a double,
or a long.  It is not both unless it is a Union, in which case the sort order is defined by
the order of the union branches, then the individual types.




Mime
View raw message