izemlyanskiy commented on pull request #1584:
URL: https://github.com/apache/avro/pull/1584#issuecomment-1073890523
I beg your very pardon for my ignorance, but @RyanSkraba and @rstata are 2
different people, right?
@RyanSkraba, thank you for your self-request, I look forward to your opinion
on this PR :pray:
@rstata you were the last person who touched
`org.apache.avro.io.parsing.ResolvingGrammarGenerator`. I've got a question for
you, in my PR we create a new instance of `GenericDatumReader` on every
conversion, it works fine but it's might be inefficient.
I thought to create such a reader in `ResolvingAction` or even create a new
`Action` and delegate all that conversation business to the action. But for
that, we need a reference of `org.apache.avro.generic.GenericData` here
`org.apache.avro.io.ResolvingDecoder#resolve`. I made an attempt and it could
be done with no harm to other code, but I didn't dare to offer such code
without a discussion.
Long story short, my suggestion is to add a `GenericData` parameter to
`org.apache.avro.io.DecoderFactory#resolvingDecoder`
and sink down it to `org.apache.avro.io.ResolvingDecoder` constructor,
method`org.apache.avro.io.ResolvingDecoder#resolve` and at the end make a field
in `org.apache.avro.io.parsing.ResolvingGrammarGenerator` in order to use it
in
`org.apache.avro.io.parsing.ResolvingGrammarGenerator#generate(org.apache.avro.Resolver.Action,
java.util.Map<java.lang.Object,org.apache.avro.io.parsing.Symbol>)` at this
moment:
```java
if (action instanceof Resolver.Promote) {
return Symbol.resolve(action.writer, action.reader,
simpleGen(action.writer, seen),
simpleGen(action.reader, seen));
```
(presumably in `Symbol.resolve` method)
Thank you for your time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]