DataFrameReader.Schema Method

Definition

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.

Applies to