Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVRO-4075: [csharp] Fix JsonDecoder string type failing to decode ISO string date #3209

Merged

Conversation

NathanielAB
Copy link
Contributor

What is the purpose of the change

Fixing AVRO-4075 where the JsonDecoder underlying package Newtonsoft was mixing strings with Date types when supplied with an ISO format.

Verifying this change

This change added tests and can be verified as follows:

Supplying an ISO format string for example: 1900-01-01T00:00:00Z in an Avro type string while reading with a JsonDecoder

Documentation

  • Does this pull request introduce a new feature? (yes / no) no
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented) not applicable

@github-actions github-actions bot added the C# label Oct 8, 2024
@@ -45,6 +45,14 @@ private class ReorderBuffer
public JsonReader OrigParser { get; set; }
}

private class AvroJsonTextReader : JsonTextReader
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could make the class sealed as well; that might help inlining in the JIT compiler. Alas, it looks like private JsonReader reader; cannot be changed to private AvroJsonTextReader reader; because DoAction assigns a JsonElementReader there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied your suggestion with regards to making the class sealed. Agreed about the reader not being able to be AvroJsonTextReader, it's unfortunate its being used differently in DoAction, but the same fix has also been applied to that reader.

@martin-g martin-g merged commit 290ce8e into apache:main Oct 16, 2024
9 checks passed
@martin-g
Copy link
Member

Thank you, @NathanielAB !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants