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