snowflake.snowpark.DataFrameReader.option¶
- DataFrameReader.option(key: str, value: Any) DataFrameReader [source]¶
Sets the specified option in the DataFrameReader.
Use this method to configure any format-specific options, copy options, and time travel options. (Note that although specifying copy options can make error handling more robust during the reading process, it may have an effect on performance.)
- Time travel options can be used with
table()
method: time_travel_mode
: Either “at” or “before”statement
: Query ID for statement-based time traveloffset
: Seconds to go back in time (negative integer)timestamp
: Specific timestamp for time traveltimestamp_type
: Type of timestamp interpretation (‘NTZ’, ‘LTZ’, or ‘TZ’).stream
: Stream name for time travel.
- Special PySpark compatibility option:
as-of-timestamp
: Automatically setstime_travel_mode
to “at” and uses the provided timestamp. Cannot be used withtime_travel_mode="before"
.
- Parameters:
key – Name of the option (e.g.
compression
,skip_header
,time_travel_mode
, etc.).value – Value of the option.
- Time travel options can be used with