/**
* Parses a column containing a CSV string into a `StructType` with the specified schema.
* Returns `null`, in the case of an unparseable string.
*
* @param e a string column containing CSV data.
* @param schema the schema to use when parsing the CSV string
* @param options options to control how the CSV is parsed. accepts the same options and the
* CSV data source.
*
* @group collection_funcs
* @since 3.0.0
*/
def from_csv(e: Column, schema: StructType, options: Map[String, String]): Column = withExpr {
CsvToStructs(schema, options, e.expr)
}
1条答案
按热度按时间i5desfxk1#
spark 3.0.0中引入了它,您可以看到回购:
https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/functions.scala
以及jira门票,包括: