avro icon indicating copy to clipboard operation
avro copied to clipboard

AVRO-3224: Fix ReflectDatumReader.readField when using ReflectData.AllowNull with two conversions that convert to the same avro logical type

Open liu-du opened this issue 4 years ago • 3 comments

Make sure you have checked all steps below.

Jira

  • [x] My PR addresses the following Avro Jira issues and references them in the PR title. For example, "AVRO-1234: My Avro PR"
    • https://issues.apache.org/jira/browse/AVRO-3224

Tests

  • [x] My PR adds the following unit tests:
    • TestReflectLogicalTypes.testReflectedSchemaWithMultipleDateConversions
    • TestReflectLogicalTypes.testReflectedSchemaWithMultipleDateConversions

Commits

  • [x] My commits all reference Jira issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • No new functionality

liu-du avatar Oct 07 '21 07:10 liu-du

@opwvhk

I changed the code a bit so now it's able to handle array of unions as well. Also the logic of apply logical conversions are now removed into one place in ReflectDatumReader.readAndConvert. Could you help review again? Thank you

liu-du avatar Feb 25 '22 08:02 liu-du

Looks a lot better now! Thank you. I've left a few minor remarks which I think would make it even better, but other than that it looks good to me.

opwvhk avatar Mar 07 '22 08:03 opwvhk

I've changed the code according to the remarks. Thank you for the review!

liu-du avatar Mar 08 '22 03:03 liu-du