StructType: StructType

Description Usage Arguments Value Examples

View source: R/schema.R

Description

Create a StructType object that contains the metadata for a SparkDataFrame. Intended for use with read functions and apply functions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
StructType(x, ...)

## S3 method for class 'jobj'
StructType(x, ...)

## S3 method for class 'character'
StructType(x, ...)

## S3 method for class 'StructField'
StructType(x, ...)

## S3 method for class 'StructType'
StructType(x, ...)

Arguments

x

a StructField object (created with the StructField method). Since Spark 2.3, this can be a DDL-formatted string, which is a comma separated list of field definitions, e.g., "a INT, b STRING".

...

additional StructField objects

Value

an object of type StructType

Examples

1
2
3
4
5
6
7
8
## Not run: 
schema <- StructType(
  StructField("a", "integer"),
  StructField("c", "string"),
  StructField("avg", "double")
  )

## End(Not run)

danzafar/tidyspark documentation built on Sept. 30, 2020, 12:19 p.m.