roboto.formats.parquet.timestamp#

Module Contents#

class roboto.formats.parquet.timestamp.Timestamp#

The timestamp field of a Parquet file, the field holding each row’s timestamp. Serves as both a descriptor of that field and as a utility for projecting its values to other time units.

Note

This is not intended as a public API.

column_index: int#

The timestamp’s position among the file’s leaf columns, which is the index of its column chunk in every row group.

field: pyarrow.Field#
path: tuple[str, ...]#

Path components locating the timestamp field in the file’s schema, root to leaf, through structs only.

to_epoch_nanoseconds(timestamp)#
Parameters:

timestamp (roboto.time.Time)

Return type:

int

unit()#
Return type:

roboto.time.TimeUnit

unit_hint: str | None#

Unit the stored values are recorded in, used when the Arrow type does not carry one.

Taken from the Unit metadata of the timestamp’s MessagePathRecord, or from the read plan’s unit. None when the unit is unknown.

class roboto.formats.parquet.timestamp.TimestampInfo#
end_time: int | float | datetime.datetime | None#
end_time_ns()#
Return type:

Optional[int]

field: pyarrow.Field#
start_time: int | float | datetime.datetime | None#
start_time_ns()#
Return type:

Optional[int]

unit: roboto.time.TimeUnit#
roboto.formats.parquet.timestamp.is_timestamp_like(arrow_type)#
Parameters:

arrow_type (pyarrow.DataType)

Return type:

bool

roboto.formats.parquet.timestamp.is_timezone_aware(arrow_type)#
Parameters:

arrow_type (pyarrow.DataType)

Return type:

bool

roboto.formats.parquet.timestamp.time_unit_from_timestamp_type(timestamp_type)#
Parameters:

timestamp_type (pyarrow.TimestampType)

Return type:

roboto.time.TimeUnit