diff --git a/lib/codec/plain.ts b/lib/codec/plain.ts index cc191a17..22871e08 100644 --- a/lib/codec/plain.ts +++ b/lib/codec/plain.ts @@ -264,16 +264,17 @@ function decodeValues_FIXED_LEN_BYTE_ARRAY( opts: Options ) { let values = []; - - if (!opts.typeLength) { + const typeLength = + opts.typeLength ?? (opts.column ? opts.column.typeLength : undefined); + if (!typeLength) { throw "missing option: typeLength (required for FIXED_LEN_BYTE_ARRAY)"; } for (let i = 0; i < count; ++i) { values.push( - cursor.buffer.slice(cursor.offset, cursor.offset + opts.typeLength) + cursor.buffer.slice(cursor.offset, cursor.offset + typeLength) ); - cursor.offset += opts.typeLength; + cursor.offset += typeLength; } return values; diff --git a/test/reference-test/read-all.test.ts b/test/reference-test/read-all.test.ts index ee33f46f..492e4055 100644 --- a/test/reference-test/read-all.test.ts +++ b/test/reference-test/read-all.test.ts @@ -24,8 +24,6 @@ const unsupported = [ 'delta_encoding_optional_column.parquet', // DELTA_BINARY_PACKED unsupported 'delta_encoding_required_column.parquet', // DELTA_BINARY_PACKED unsupported 'delta_length_byte_array.parquet', // ZSTD unsupported, DELTA_BINARY_PACKED unsupported - 'float16_nonzeros_and_nans.parquet', // missing option: typeLength (required for FIXED_LEN_BYTE_ARRAY) - 'float16_zeros_and_nans.parquet', // missing option: typeLength (required for FIXED_LEN_BYTE_ARRAY) 'large_string_map.brotli.parquet', // BUG? ];