ray.data.read_datasource#
- ray.data.read_datasource(datasource: Datasource, *, parallelism: int = -1, ray_remote_args: Dict[str, Any] = None, concurrency: int | None = None, override_num_blocks: int | None = None, **read_args) Dataset[source]#
Read a stream from a custom
Datasource.- Parameters:
datasource – The
Datasourceto read data from.parallelism – This argument is deprecated. Use
override_num_blocksargument.ray_remote_args – kwargs passed to
ray.remote()in the read tasks.concurrency – The maximum number of Ray tasks to run concurrently. Set this to control number of tasks to run concurrently. This doesn’t change the total number of tasks run or the total number of output blocks. By default, concurrency is dynamically decided based on the available resources.
override_num_blocks – Override the number of output blocks from all read tasks. By default, the number of output blocks is dynamically decided based on input data size and available resources. You shouldn’t manually set this value in most cases.
read_args – Additional kwargs to pass to the
Datasourceimplementation.
- Returns:
Datasetthat reads data from theDatasource.