ak.from_avro_file#

Defined in awkward.operations.ak_from_avro_file on line 17.

ak.from_avro_file(file, limit_entries=None, *, debug_forth=False, highlevel=True, behavior=None, attrs=None)#

Reads an Avro file as an Awkward Array.

Internally this function uses AwkwardForth DSL. The function recursively parses the Avro schema, generates Awkward form and Forth code for that specific Avro file and then reads it.

Parameters:
  • file (path-like or file-like object) – Avro file to be read as Awkward Array.

  • limit_entries (int) – The number of rows of the Avro file to be read into the Awkward Array.

  • debug_forth (bool) – If True, prints the generated Forth code for debugging.

  • highlevel (bool) – If True, return an ak.Array; otherwise, return a low-level ak.contents.Content subclass.

  • behavior (None or dict) – Custom ak.behavior for the output array, if high-level.

  • attrs (None or dict) – Custom attributes for the output array, if high-level.

Returns:

An ak.Array read from the given Avro file.