DataFrameReader.Schema Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Schema(StructType) |
Specifies the schema by using StructType. |
Schema(String) |
Specifies the schema by using the given DDL-formatted string. |
Schema(StructType)
Specifies the schema by using StructType.
public Microsoft.Spark.Sql.DataFrameReader Schema (Microsoft.Spark.Sql.Types.StructType schema);
member this.Schema : Microsoft.Spark.Sql.Types.StructType -> Microsoft.Spark.Sql.DataFrameReader
Public Function Schema (schema As StructType) As DataFrameReader
Parameters
- schema
- StructType
The input schema
Returns
This DataFrameReader object
Remarks
Some data sources (e.g. JSON) can infer the input schema automatically from data. By specifying the schema here, the underlying data source can skip the schema inference step, and thus speed up data loading.
Applies to
Schema(String)
Specifies the schema by using the given DDL-formatted string.
public Microsoft.Spark.Sql.DataFrameReader Schema (string schemaString);
member this.Schema : string -> Microsoft.Spark.Sql.DataFrameReader
Public Function Schema (schemaString As String) As DataFrameReader
Parameters
- schemaString
- String
DDL-formatted string
Returns
This DataFrameReader object
Remarks
Some data sources (e.g. JSON) can infer the input schema automatically from data. By specifying the schema here, the underlying data source can skip the schema inference step, and thus speed up data loading.