(
    decoder,
    header,
    codec,
    writer_schema,
    named_schemas,
    reader_schema,
    return_record_name=False,
)
Return iterator over avro blocks.
Return iterator over avro blocks.
Return iterator over avro blocks .
def _iter_avro_blocks(
    decoder,
    header,
    codec,
    writer_schema,
    named_schemas,
    reader_schema,
    return_record_name=False,
):
    """Return iterator over avro blocks."""
    sync_marker = header["sync"]

    read_block = BLOCK_READERS.get(codec)
    if not read_block:
        raise ValueError(f"Unrecognized codec: {codec}")

    while True:
        offset = decoder.fo.tell()
        try:
            num_block_records = decoder.read_long()
        except StopIteration:
            return

        block_bytes = read_block(decoder)

        skip_sync(decoder.fo, sync_marker)

        size = decoder.fo.tell() - offset

        yield Block(
            block_bytes,
            num_block_records,
            codec,
            reader_schema,
            writer_schema,
            named_schemas,
            offset,
            size,
            return_record_name,
        )
def _iter_avro_blocks ( decoder , header , codec , writer_schema , named_schemas , reader_schema , return_record_name = False , ) : sync_marker = header [ "sync" ] read_block = BLOCK_READERS . get ( codec ) if not read_block : raise ValueError ( f"Unrecognized codec: {codec}" ) while True : offset = decoder . fo . tell ( ) try : num_block_records = decoder . read_long ( ) except StopIteration : return block_bytes = read_block ( decoder ) skip_sync ( decoder . fo , sync_marker ) size = decoder . fo . tell ( ) - offset yield Block ( block_bytes , num_block_records , codec , reader_schema , writer_schema , named_schemas , offset , size , return_record_name , )