schema-types: 'tidyspark' Schema Types

Description Usage Arguments Format Value Examples

Description

Schema types that can be used in specifiying schemas in tidyspark. These are typically used in the creation of 'StructField' objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21

Arguments

type

a schema object or valid string

nullable

logical, if the field allows null values

key

a schema object or string representing the key's type

value

a schema object or string representing the value's type

Format

An object of class character of length 1.

An object of class character of length 1.

An object of class character of length 1.

An object of class character of length 1.

An object of class character of length 1.

An object of class character of length 1.

An object of class character of length 1.

An object of class character of length 1.

An object of class character of length 1.

Value

a string or if it's a nested type a jobj

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
StructType(
  StructField("int", IntegerType, TRUE),
  StructField("string", StringType, TRUE)
)

StructType(
  StructField("array", ArrayType(IntegerType, TRUE), TRUE),
  StructField("dict", StructType(
    StructField("extra_key", StringType, TRUE),
    StructField("key", StringType, TRUE)
  ), TRUE),
  StructField("int", IntegerType, TRUE),
  StructField("string", StringType, TRUE)
  )

## End(Not run)

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