avro
avro copied to clipboard
AVRO-3377: Deserialization of record of mangled Java class throws ClassCastException
The biggest change in this code is moving the mangling code from the compiler project to the core avro project in order to facilitate mangling at deserialization time.
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-3377
Tests
- [X] My PR adds the following unit tests OR does not need testing for this extremely good reason:
- TestSpecificData.testCanGetClassOfMangledType
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":
- Subject is separated from body by a blank line
- Subject is limited to 50 characters (not including Jira issue reference)
- Subject does not end with a period
- Subject uses the imperative mood ("add", not "adding")
- Body wraps at 72 characters
- Body explains "what" and "why", not "how"
Documentation
- [X] In case of new functionality, my PR adds documentation that describes how to use it.
- All the public functions and the classes in the PR contain Javadoc that explain what it does
Hey, is it still planned to merge this in 1.11.2? Is there a workaround in the meantime?
PR approved (as code for mangle is moved from SpecificCompiler to SpecificData) with some remarks :
- Mangle can transform word with point as "dummy.int.float" into "dummy.int$.float$" for example, as unmangle method only apply on last char (==> "dummy.int$.float" in our case).
- Mangle only applies to reserved word, so transform "dummy$" to itself, while unmangle apply to all word (==> "dummy" in our case).
- As it's a lot of static method, it may could be extract in external class.
I'm also looking for a workaround until this ticket is implemented.
Hey, any idea of when this will be merged/released or any sample/tips on a workaround?
@hmsantos, i'm sorry, i forgot this PR, at this time, i didn't had right to merge PR. Nevertheless, you have to resolve conflict before merging.
@kylec32 can you please resolve the conflicts in your PR? Thanks