read.json {SparkR}R Documentation

Create a DataFrame from a JSON file.

Description

Loads a JSON file (one object per line), returning the result as a DataFrame It goes through the entire dataset once to determine the schema.

Usage

read.json(sqlContext, path)

jsonFile(sqlContext, path)

Arguments

sqlContext

SQLContext to use

path

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

Value

DataFrame

Examples

## Not run: 
sc <- sparkR.init()
sqlContext <- sparkRSQL.init(sc)
path <- "path/to/file.json"
df <- read.json(sqlContext, path)
df <- jsonFile(sqlContext, path)

## End(Not run)

[Package SparkR version 1.6.0 Index]