avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dr. Martin Menzel (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1505) Generic comparator features definable in avro schema
Date Sat, 10 May 2014 22:06:53 GMT

     [ https://issues.apache.org/jira/browse/AVRO-1505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dr. Martin Menzel updated AVRO-1505:
------------------------------------

    Attachment: TestGenericComparator.java
                GenericData.java

The patched Original GenericData class and my Test class

> Generic comparator features definable in avro schema
> ----------------------------------------------------
>
>                 Key: AVRO-1505
>                 URL: https://issues.apache.org/jira/browse/AVRO-1505
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>    Affects Versions: 1.7.6
>         Environment: same as for hadoop 2.3.0
>            Reporter: Dr. Martin Menzel
>            Priority: Minor
>              Labels: patch
>             Fix For: 1.7.7
>
>         Attachments: AVRO-1505.patch.gz, CompoundDataExportKeyExtended2.avsc, GenericComparator.java,
GenericData.java, TestGenericComparator.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> This patch allows to add additional optional comparator informations to the avro schema
for record types.
> An example is included in the patch 
> CompoundDataExportKeyExtended2.avsc
> ...snip...
>      {"name": "seqNo", "type": "int",                       "comparators" : [
>                                                                            { "name":"default",
  "compareIdx" : 3, "order":"ascending" }, 
>                                                                            { "name":"grouping1",
"compareIdx" : 3, "order":"ignore"  } ,
>                                                                            { "name":"grouping2",
"compareIdx" : 3, "order":"ignore"  } 
>                                                                          ]},
> ...snip...
> in the comparators property of a field definition multiple compartor informations can
be defined. Often used when defining GroupingCompartors with compound keys is order="ignore"
so that the keys are just compared with respect to some special (not ignored fields)
> The necessary changes are made in GenericData class with a fall back to the standard
behavior if no comparators are defined.
> An example generic Compartor is delivered with this patch called:
> org.woopi.avro.GenericComparator
> Maybe this class can be included in the avro bundle. In this case the package can be
adapted to org.apache.
> The TestCase tests several different situations and is called.
> TestGenericComparator.java



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message