Package org.apache.wayang.spark.util
Class DatasetConverters
java.lang.Object
org.apache.wayang.spark.util.DatasetConverters
Utility methods to convert
Record-backed RDDs into Spark Datasets.-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>recordsToDataset(org.apache.spark.api.java.JavaRDD<Record> records, DataSetType<Record> dataSetType, org.apache.spark.sql.SparkSession sparkSession) Convert an RDD ofRecords into a SparkDataset.
-
Method Details
-
recordsToDataset
public static org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> recordsToDataset(org.apache.spark.api.java.JavaRDD<Record> records, DataSetType<Record> dataSetType, org.apache.spark.sql.SparkSession sparkSession) Convert an RDD ofRecords into a SparkDataset.- Parameters:
records- the records to convertdataSetType- type information about the records (field names etc.)sparkSession- theSparkSessionused to create theDataset- Returns:
- a
Datasetview overrecords
-