Github user MaxGekk commented on a diff in the pull request:
https://github.com/apache/spark/pull/21686#discussion_r199899708
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/functions.scala ---
@@ -3381,6 +3381,48 @@ object functions {
from_json(e, dataType, options)
}
+ /**
+ * (Scala-specific) Parses a column containing a JSON string into a
`MapType` with `StringType`
+ * as keys type, `StructType` or `ArrayType` of `StructType`s with the
specified schema.
+ * Returns `null`, in the case of an unparseable string.
+ *
+ * @param e a string column containing JSON data.
+ * @param schema the schema to use when parsing the json string
+ *
+ * @group collection_funcs
+ * @since 2.4.0
+ */
+ def from_json(e: Column, schema: Column): Column = {
+ from_json(e, schema, Map.empty[String, String].asJava)
+ }
+
+ /**
+ * (Java-specific) Parses a column containing a JSON string into a
`MapType` with `StringType`
+ * as keys type, `StructType` or `ArrayType` of `StructType`s with the
specified schema.
+ * Returns `null`, in the case of an unparseable string.
+ *
+ * @param e a string column containing JSON data.
+ * @param schema the schema to use when parsing the json string
+ * @param options options to control how the json is parsed. accepts the
same options and the
+ * json data source.
+ *
+ * @group collection_funcs
+ * @since 2.4.0
+ */
+ def from_json(e: Column, schema: Column, options: java.util.Map[String,
String]): Column = {
--- End diff --
we call the method from python:
https://github.com/apache/spark/pull/21686/files#diff-f5295f69bfbdbf6e161aed54057ea36dR2202
Do you really want to revert changes for python?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]