Database Reference
In-Depth Information
schema originally used to write the data. For example, the following reader's schema can
be used to read
StringPair
data with the new field names
first
and
second
in-
stead of
left
and
right
(which are what it was written with):
{
"type"
:
"record"
,
"name"
:
"StringPair"
,
"doc"
:
"A pair of strings with aliased field names."
,
"fields"
: [
{
"name"
:
"first"
,
"type"
:
"string"
,
"aliases"
:
[
"left"
]
},
{
"name"
:
"second"
,
"type"
:
"string"
,
"aliases"
:
[
"right"
]
}
]
}
Note that the aliases are used to translate (at read time) the writer's schema into the read-
er's, but the alias names are not available to the reader. In this example, the reader cannot
use the field names
left
and
right
, because they have already been translated to
first
and
second
.