twmb opened a new pull request, #1692:
URL: https://github.com/apache/arrow-go/pull/1692

   Fixes for the OCF reader, most of them for reads that broke when arrow/avro 
switched from hamba/avro to twmb/avro in #830:
   
   * The loader looked up each value by a path of keys written for the shapes 
hamba/avro decoded. With twmb/avro, a ["null", record] field and a record two 
or more levels inside an array or map read as nulls, values after a null record 
shifted, a record field named "value" or "item" lost its nested fields, an 
array of maps panicked and crashed the process, and maps of maps, arrays of 
arrays, and maps of arrays returned errors or dropped values. The loader is now 
recursive appenders: each list, map, and struct builder appends its own items, 
keys and values, or fields. All of these read correctly.
   * A record that contains itself, such as a Node with a ["null","Node"] 
field, recursed until the Go stack overflowed, a fatal error that recover 
cannot catch, including for a schema read from an untrusted file header. The 
conversion now returns an error that names the record.
   * A field of Avro type "null" crashed the process. It now reads as an Arrow 
null column.
   * An unknown logical type, or one on an underlying type the spec does not 
allow, such as time-millis on a long or uuid on a fixed(4), failed the read. 
Such a field now reads as its underlying type, as the spec says and as 
twmb/avro decodes it.
   * A field-level logicalType, as in 
{"name":"f","type":"long","logicalType":"timestamp-millis"}, which Confluent's 
code generator and most Debezium sources write, failed the read, because 
twmb/avro lifts it onto the type and the conversion did not. The conversion now 
applies it the same way.
   * A big-decimal field (Avro 1.12) failed the whole file with "field with nil 
DataType". It now reads as a string column of each value's exact decimal text. 
A value written as 1.50 reads as "1.5", because twmb/avro does not keep the 
scale each value was written with.
   * A record with a dotted name, such as "x.A", could not be referenced by its 
short name from inside its namespace.
   
   Existing readers may notice:
   
   * uuid on bytes reads as a Binary column instead of a UUID column, which 
failed for any value that was not 16 bytes.
   * A field-level uuid on a string reads as a UUID column instead of a string 
column.
   * A WithSchemaEdit that gives a field a type its data does not have returns 
an error. Before, an edit to an array wrapped each value in a one-element list, 
an edit to a record read nulls, and an edit to a map crashed the process or 
returned no rows.
   * Fields that read as null before, such as ["null", record] fields, read 
their values.
   
   Each fix has rows in TestOCFReaderValues or the schema tests that fail 
without it.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to