Details
-
New Feature
-
Status: Patch Available
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The attached patch allows reading a JSON-formatted text file in, converting to a conforming Avro text file, emitting one record per line, e.g., it can read this input file:
{"intval":12} {"intval":-73,"strval":"hello, there!!"}with this schema:
{ "type":"record", "name":"TestRecord", "fields": [
,
{"name":"strval","type":["string", "null"]}]}
returning valid Avro. This is different than the DataFileWriteTool, which would read in the following internal encoding:
{"intval":12,"strval":null}{"intval":-73,"strval":{"string":"hello, there!!"}}
In general, the internal encodings used by Avro aren't natural when reading in JSON text that appears in the wild. Likewise, this utility allows changing invalid Avro identifier characters into an underscore, again to tolerate JSON that wasn't designed to be readable by Avro.