public class SQLUtils
extends Object
Constructor and Description |
---|
SQLUtils() |
Modifier and Type | Method and Description |
---|---|
static ArrayType |
createArrayType(Column column) |
static Dataset<Row> |
createDF(RDD<byte[]> rdd,
StructType schema,
SparkSession sparkSession) |
static StructField |
createStructField(String name,
String dataType,
boolean nullable) |
static StructType |
createStructType(scala.collection.Seq<StructField> fields) |
static Dataset<Row> |
dapply(Dataset<Row> df,
byte[] func,
byte[] packageNames,
Object[] broadcastVars,
StructType schema)
The helper function for dapply() on R side.
|
static Object[][] |
dfToCols(Dataset<Row> df) |
static JavaRDD<byte[]> |
dfToRowRDD(Dataset<Row> df) |
static Dataset<Row> |
gapply(RelationalGroupedDataset gd,
byte[] func,
byte[] packageNames,
Object[] broadcastVars,
StructType schema)
The helper function for gapply() on R side.
|
static JavaSparkContext |
getJavaSparkContext(SparkSession spark) |
static SparkSession |
getOrCreateSparkSession(JavaSparkContext jsc,
java.util.Map<Object,Object> sparkConfigMap,
boolean enableHiveSupport) |
static java.util.Map<String,String> |
getSessionConf(SparkSession spark) |
static String[] |
getTableNames(SparkSession sparkSession,
String databaseName) |
static void |
org$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1) |
static org.slf4j.Logger |
org$apache$spark$internal$Logging$$log_() |
static JavaRDD<byte[]> |
readArrowStreamFromFile(SparkSession sparkSession,
String filename)
R callable function to read a file in Arrow stream format and create an
RDD
using each serialized ArrowRecordBatch as a partition. |
static Object |
readSqlObject(java.io.DataInputStream dis,
char dataType) |
static StructType |
SERIALIZED_R_DATA_SCHEMA() |
static void |
setSparkContextSessionConf(SparkSession spark,
java.util.Map<Object,Object> sparkConfigMap) |
static Dataset<Row> |
toDataFrame(JavaRDD<byte[]> arrowBatchRDD,
StructType schema,
SparkSession sparkSession)
R callable function to create a
DataFrame from a JavaRDD of serialized
ArrowRecordBatches. |
static boolean |
writeSqlObject(java.io.DataOutputStream dos,
Object obj) |
public static SparkSession getOrCreateSparkSession(JavaSparkContext jsc, java.util.Map<Object,Object> sparkConfigMap, boolean enableHiveSupport)
public static void setSparkContextSessionConf(SparkSession spark, java.util.Map<Object,Object> sparkConfigMap)
public static java.util.Map<String,String> getSessionConf(SparkSession spark)
public static JavaSparkContext getJavaSparkContext(SparkSession spark)
public static StructType createStructType(scala.collection.Seq<StructField> fields)
public static StructField createStructField(String name, String dataType, boolean nullable)
public static Dataset<Row> createDF(RDD<byte[]> rdd, StructType schema, SparkSession sparkSession)
public static StructType SERIALIZED_R_DATA_SCHEMA()
public static Dataset<Row> dapply(Dataset<Row> df, byte[] func, byte[] packageNames, Object[] broadcastVars, StructType schema)
df
- (undocumented)func
- (undocumented)packageNames
- (undocumented)broadcastVars
- (undocumented)schema
- (undocumented)public static Dataset<Row> gapply(RelationalGroupedDataset gd, byte[] func, byte[] packageNames, Object[] broadcastVars, StructType schema)
gd
- (undocumented)func
- (undocumented)packageNames
- (undocumented)broadcastVars
- (undocumented)schema
- (undocumented)public static Object readSqlObject(java.io.DataInputStream dis, char dataType)
public static boolean writeSqlObject(java.io.DataOutputStream dos, Object obj)
public static String[] getTableNames(SparkSession sparkSession, String databaseName)
public static JavaRDD<byte[]> readArrowStreamFromFile(SparkSession sparkSession, String filename)
RDD
using each serialized ArrowRecordBatch as a partition.sparkSession
- (undocumented)filename
- (undocumented)public static Dataset<Row> toDataFrame(JavaRDD<byte[]> arrowBatchRDD, StructType schema, SparkSession sparkSession)
DataFrame
from a JavaRDD
of serialized
ArrowRecordBatches.arrowBatchRDD
- (undocumented)schema
- (undocumented)sparkSession
- (undocumented)public static org.slf4j.Logger org$apache$spark$internal$Logging$$log_()
public static void org$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1)