| Constructor and Description |
|---|
JsonRDD() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.spark.sql.types.DataType |
compatibleType(org.apache.spark.sql.types.DataType t1,
org.apache.spark.sql.types.DataType t2)
Returns the most general data type for two given data types.
|
static Object |
enforceCorrectType(Object value,
org.apache.spark.sql.types.DataType desiredType) |
static org.apache.spark.sql.types.StructType |
inferSchema(RDD<String> json,
double samplingRatio,
String columnNameOfCorruptRecords) |
static RDD<org.apache.spark.sql.Row> |
jsonStringToRow(RDD<String> json,
org.apache.spark.sql.types.StructType schema,
String columnNameOfCorruptRecords) |
static org.apache.spark.sql.types.StructType |
nullTypeToStringType(org.apache.spark.sql.types.StructType struct) |
static void |
rowToJSON(org.apache.spark.sql.types.StructType rowSchema,
com.fasterxml.jackson.core.JsonGenerator gen,
org.apache.spark.sql.Row row)
Transforms a single Row to JSON using Jackson
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarningpublic static RDD<org.apache.spark.sql.Row> jsonStringToRow(RDD<String> json, org.apache.spark.sql.types.StructType schema, String columnNameOfCorruptRecords)
public static org.apache.spark.sql.types.StructType inferSchema(RDD<String> json, double samplingRatio, String columnNameOfCorruptRecords)
public static org.apache.spark.sql.types.StructType nullTypeToStringType(org.apache.spark.sql.types.StructType struct)
public static org.apache.spark.sql.types.DataType compatibleType(org.apache.spark.sql.types.DataType t1,
org.apache.spark.sql.types.DataType t2)
public static Object enforceCorrectType(Object value,
org.apache.spark.sql.types.DataType desiredType)
public static void rowToJSON(org.apache.spark.sql.types.StructType rowSchema,
com.fasterxml.jackson.core.JsonGenerator gen,
org.apache.spark.sql.Row row)
rowSchema - the schema object used for conversiongen - a JsonGenerator objectrow - The row to convert