| from_json {SparkR} | R Documentation |
Parses a column containing a JSON string into a Column of structType with the specified
schema or array of structType if as.json.array is set to TRUE.
If the string is unparseable, the Column will contains the value NA.
from_json(x, schema, ...) ## S4 method for signature 'Column,structType' from_json(x, schema, as.json.array = FALSE, ...)
x |
Column containing the JSON string. |
schema |
a structType object to use as the schema to use when parsing the JSON string. |
... |
additional named properties to control how the json is parsed, accepts the same options as the JSON data source. |
as.json.array |
indicating if input string is JSON array of objects or a single object. |
from_json since 2.2.0
Other normal_funcs: abs,
bitwiseNOT, coalesce,
column, expr,
greatest, ifelse,
isnan, least,
lit, nanvl,
negate, randn,
rand, struct,
to_json, when
## Not run:
##D schema <- structType(structField("name", "string"),
##D select(df, from_json(df$value, schema, dateFormat = "dd/MM/yyyy"))
## End(Not run)