FileBasedDatasource#

class ray.data.datasource.FileBasedDatasource(*args, **kwargs)[source]#

Bases: Datasource

File-based datasource for reading files.

Don’t use this class directly. Instead, subclass it and implement _read_stream().

DeveloperAPI: This API may change across minor Ray releases.

Methods

apply_predicate

Apply a predicate to this datasource.

apply_projection

Apply a projection (column selection) to this datasource.

create_reader

Deprecated: Implement get_read_tasks() and estimate_inmemory_data_size() instead.

get_name

Return a human-readable name for this datasource.

get_projection_map

Return the projection map (always an identity mapping).

guarded_estimate_inmemory_data_size

Estimate the in-memory data size with unpickling refused.

guarded_get_read_tasks

Call get_read_tasks() with unpickling refused.

prepare_read

Deprecated: Implement get_read_tasks() and estimate_inmemory_data_size() instead.

resolve_compression

Resolves the compression format for a stream.

supports_projection_pushdown

Returns True in case Datasource supports projection operation being pushed down into the reading layer

Attributes

should_create_reader

Return True if the datasource should create a legacy reader

supports_distributed_reads

If False, only launch read tasks on the driver's node.