| Modifier and Type | Method and Description |
|---|---|
static co.cask.cdap.api.data.format.StructuredRecord |
fromRow(org.apache.spark.sql.Row row,
co.cask.cdap.api.data.schema.Schema schema)
Creates a
StructuredRecord from the data in the given Row. |
static <T extends org.apache.spark.sql.types.DataType> |
toDataType(co.cask.cdap.api.data.schema.Schema schema)
Converts a
Schema to Spark DataType. |
static <T extends org.apache.spark.sql.types.DataType> |
toDataType(co.cask.cdap.api.data.schema.Schema schema,
scala.Function1<co.cask.cdap.api.data.schema.Schema,org.apache.spark.sql.types.DataType> unionSelector)
Converts a
Schema to Spark DataType. |
static org.apache.spark.sql.Row |
toRow(co.cask.cdap.api.data.format.StructuredRecord record,
org.apache.spark.sql.types.StructType structType)
Creates a
Row object that represents data in the given StructuredRecord. |
static co.cask.cdap.api.data.schema.Schema |
toSchema(org.apache.spark.sql.types.DataType dataType)
Converts a Spark
DataType to a Schema object. |
public static <T extends org.apache.spark.sql.types.DataType> T toDataType(co.cask.cdap.api.data.schema.Schema schema)
Schema to Spark DataType.schema - the schema to convertDataTypepublic static <T extends org.apache.spark.sql.types.DataType> T toDataType(co.cask.cdap.api.data.schema.Schema schema, scala.Function1<co.cask.cdap.api.data.schema.Schema,org.apache.spark.sql.types.DataType> unionSelector)
Schema to Spark DataType.schema - the schema to convertunionSelector - the function to pick which schema to use when a Schema.Type#UNION type schema
is encounteredDataTypepublic static co.cask.cdap.api.data.schema.Schema toSchema(org.apache.spark.sql.types.DataType dataType)
DataType to a Schema object.dataType - the data type to convert fromSchemapublic static org.apache.spark.sql.Row toRow(co.cask.cdap.api.data.format.StructuredRecord record, org.apache.spark.sql.types.StructType structType)
Row object that represents data in the given StructuredRecord.record - contains the record datastructType - a StructType representing the data type in the resulting Row.Row instancepublic static co.cask.cdap.api.data.format.StructuredRecord fromRow(org.apache.spark.sql.Row row, co.cask.cdap.api.data.schema.Schema schema)
StructuredRecord from the data in the given Row.row - contains the record dataschema - the Schema of the resulting StructuredRecord.StructuredRecord instanceCopyright © 2018 Cask Data, Inc. Licensed under the Apache License, Version 2.0.