You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/05/19 22:29:00 UTC
[jira] [Work logged] (AVRO-3520) CustomEncoding doesn't expose the read schema
[ https://issues.apache.org/jira/browse/AVRO-3520?focusedWorklogId=772618&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-772618 ]
ASF GitHub Bot logged work on AVRO-3520:
----------------------------------------
Author: ASF GitHub Bot
Created on: 19/May/22 22:28
Start Date: 19/May/22 22:28
Worklog Time Spent: 10m
Work Description: itstheceo opened a new pull request, #1692:
URL: https://github.com/apache/avro/pull/1692
Currently the read schema is not exposed when using `CustomEncoding<T>` which makes detecting schema changes impossible without rolling your own versioning inside the record itself. This is not an option for files that already exist, and it adds overhead by adding the version to every row in the file.
To address this issue I added a `CustomEncoderFieldAccess` interface and set the read schema onto the encoder for the respective field accessor. This method can be overridden in the concrete implementation of `CustomEncoding<T>` enabling the detection of a schema change in a way that makes backwards compatible reads possible.
### Jira
- [x] My PR addresses the following [Avro Jira](https://issues.apache.org/jira/browse/AVRO/) issues and references them in the PR title.
- https://issues.apache.org/jira/browse/AVRO-3520
### Tests
- [x] My PR adds the following unit tests.
- TestReflectCustomEncoderFieldAccess
### 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](https://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
1. Subject is limited to 50 characters (not including Jira issue reference)
1. Subject does not end with a period
1. Subject uses the imperative mood ("add", not "adding")
1. Body wraps at 72 characters
1. 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
Issue Time Tracking
-------------------
Worklog Id: (was: 772618)
Remaining Estimate: 0h
Time Spent: 10m
> CustomEncoding doesn't expose the read schema
> ---------------------------------------------
>
> Key: AVRO-3520
> URL: https://issues.apache.org/jira/browse/AVRO-3520
> Project: Apache Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.11.0
> Reporter: Colin
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Currently it is not possible to detect a schema change when using `CustomEncoding<T>`.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)