You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Johannes Schulte <jo...@gmail.com> on 2013/06/03 18:18:27 UTC

Map Reduce Jobs bound to "String" StringType

Hi,

am I right with saying: When using the Map Reduce new API, there are always
Java Strings created for avro string types?

I know about the "avro.string.type" property but even when leaving this
untouched, I get Strings.

In AvroRecordReaderBase there is a ReflectDatumReader instantiated

 mAvroFileReader = createAvroFileReader(seekableFileInput,

        new ReflectDatumReader<T>(mReaderSchema));


and in this this method is always called:


  @Override

  protected Object readString(Object old, Decoder in) throws IOException {

    return super.readString(null, in).toString();

  }


Is there a way to circumvent this and keep using Utf8?


Cheers,


Johannnes

Re: Map Reduce Jobs bound to "String" StringType

Posted by Johannes Schulte <jo...@gmail.com>.
Doug, thanks for the response after such a long time. We're looking forward
to 1.7.5 and this feature.


On Tue, Aug 13, 2013 at 7:28 PM, Doug Cutting <cu...@apache.org> wrote:

> This is fixed in AVRO-1353 and will be in (soon to be released) 1.7.5.
>
> https://issues.apache.org/jira/browse/AVRO-1353
>
> Doug
>
> On Mon, Jun 3, 2013 at 9:18 AM, Johannes Schulte
> <jo...@gmail.com> wrote:
> > Hi,
> >
> > am I right with saying: When using the Map Reduce new API, there are
> always
> > Java Strings created for avro string types?
> >
> > I know about the "avro.string.type" property but even when leaving this
> > untouched, I get Strings.
> >
> > In AvroRecordReaderBase there is a ReflectDatumReader instantiated
> >
> >  mAvroFileReader = createAvroFileReader(seekableFileInput,
> >
> >         new ReflectDatumReader<T>(mReaderSchema));
> >
> >
> > and in this this method is always called:
> >
> >
> >   @Override
> >
> >   protected Object readString(Object old, Decoder in) throws IOException
> {
> >
> >     return super.readString(null, in).toString();
> >
> >   }
> >
> >
> > Is there a way to circumvent this and keep using Utf8?
> >
> >
> > Cheers,
> >
> >
> > Johannnes
> >
> >
> >
>

Re: Map Reduce Jobs bound to "String" StringType

Posted by Doug Cutting <cu...@apache.org>.
This is fixed in AVRO-1353 and will be in (soon to be released) 1.7.5.

https://issues.apache.org/jira/browse/AVRO-1353

Doug

On Mon, Jun 3, 2013 at 9:18 AM, Johannes Schulte
<jo...@gmail.com> wrote:
> Hi,
>
> am I right with saying: When using the Map Reduce new API, there are always
> Java Strings created for avro string types?
>
> I know about the "avro.string.type" property but even when leaving this
> untouched, I get Strings.
>
> In AvroRecordReaderBase there is a ReflectDatumReader instantiated
>
>  mAvroFileReader = createAvroFileReader(seekableFileInput,
>
>         new ReflectDatumReader<T>(mReaderSchema));
>
>
> and in this this method is always called:
>
>
>   @Override
>
>   protected Object readString(Object old, Decoder in) throws IOException {
>
>     return super.readString(null, in).toString();
>
>   }
>
>
> Is there a way to circumvent this and keep using Utf8?
>
>
> Cheers,
>
>
> Johannnes
>
>
>