DataStreamReader.
csv
Loads a CSV file stream and returns the result as a DataFrame.
DataFrame
This function will go through the input once to determine the input schema if inferSchema is enabled. To avoid going through the entire data once, disable inferSchema option or specify the schema explicitly using schema.
inferSchema
schema
string, or list of strings, for input path(s).
pyspark.sql.types.StructType
an optional pyspark.sql.types.StructType for the input schema or a DDL-formatted string (For example col0 INT, col1 DOUBLE).
col0 INT, col1 DOUBLE
For the extra options, refer to Data Source Option in the version you use.
Notes
This API is evolving.
Examples
>>> csv_sdf = spark.readStream.csv(tempfile.mkdtemp(), schema = sdf_schema) >>> csv_sdf.isStreaming True >>> csv_sdf.schema == sdf_schema True