titus.datatype.AvroField

class titus.datatype.AvroField(name, avroType, default=None, order=None)[source]

Bases: object

Field of a titus.datatype.AvroRecord.

__init__(name, avroType, default=None, order=None)

Create an AvroField manually.

Parameters:
  • name (string) – field name
  • avroType (titus.datatype.AvroType) – field type
  • default (value or NoneType) – default value or None
  • order (“ascending”, “descending”, or “ignore”) – sort order (used in Hadoop secondary sort)
avroType

Get the field type as a titus.datatype.AvroType.

default

Get the field default value.

static fromSchema(schema)

Create a field from an avro.schema.Schema.

jsonNode(memo)

Get the field as a Python-encoded JSON node.

name

Get the field name.

order

Get the field order.

schema

Get the field type as an avro.schema.Schema.