read.json: Create a SparkDataFrame from a JSON file.

Description Usage Arguments Value Note Examples

View source: R/SQLContext.R

Description

Loads a JSON file, returning the result as a SparkDataFrame By default, (JSON Lines text format or newline-delimited JSON ) is supported. For JSON (one record per file), set a named property multiLine to TRUE. It goes through the entire dataset once to determine the schema.

Usage

1
read.json(path, ...)

Arguments

path

Path of file to read. A vector of multiple paths is allowed.

...

additional external data source specific named properties.

Value

SparkDataFrame

Note

read.json since 1.6.0

Examples

1
2
3
4
5
6
7
## Not run: 
sparkR.session()
path <- "path/to/file.json"
df <- read.json(path)
df <- read.json(path, multiLine = TRUE)

## End(Not run)

SparkR documentation built on June 3, 2021, 5:05 p.m.