[
https://issues.apache.org/jira/browse/AVRO-1338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christophe Taton updated AVRO-1338:
-----------------------------------
Description:
Record R is written using schema S1:
{code:title=S1}
record Record {
int i = 0;
}
{code}
I read R using a my own reader schema S2:
{code:title=S2}
record Record {
string s = "";
}
{code}
Rewriting R using S2 will discard fields from S1 that are unknown in S2 (that
is Record.i is lost).
Ideally, there would be a way to maintain fields from S1 that are invisible
through S2.
Writing R back without such loss implies merging S1 and S2 into a single schema
that contains all fields from S1 and all fields from S2:
{code:title=Merged(S1,S2)}
record Record {
int i = 0;
string s = "";
}
{code}
was:
Record R is written using schema S1: {{ record Record { int i = 0 } }}
I read R using a my own reader schema S2: {{ record Record { string s = "" } }}
Rewriting R using S2 will discard fields from S1 that are unknown in S2 (that
is Record.i is lost).
Ideally, there would be a way to maintain fields from S1 that are invisible
through S2.
Writing R back without such loss implies merging S1 and S2 into a single schema
that contains all fields from S1 and all fields from S2.
> Rewrite records with a reader schema different from the writer schema without
> losing fields from writer schema.
> ---------------------------------------------------------------------------------------------------------------
>
> Key: AVRO-1338
> URL: https://issues.apache.org/jira/browse/AVRO-1338
> Project: Avro
> Issue Type: New Feature
> Components: java
> Affects Versions: 1.7.2
> Reporter: Christophe Taton
>
> Record R is written using schema S1:
> {code:title=S1}
> record Record {
> int i = 0;
> }
> {code}
> I read R using a my own reader schema S2:
> {code:title=S2}
> record Record {
> string s = "";
> }
> {code}
> Rewriting R using S2 will discard fields from S1 that are unknown in S2 (that
> is Record.i is lost).
> Ideally, there would be a way to maintain fields from S1 that are invisible
> through S2.
> Writing R back without such loss implies merging S1 and S2 into a single
> schema that contains all fields from S1 and all fields from S2:
> {code:title=Merged(S1,S2)}
> record Record {
> int i = 0;
> string s = "";
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira