Details
Description
It seems the spark-sql job is successfully done in addition to the livy-server log and the spark-web-ui.
but some problems just show up at the later procedure.
the following is my spark-sql job implement:
class SQLQueryJob(tableName: String, sql: String, schemas: JMap[String,String]) extends Job[JList[Row]] { override def call(jc: JobContext): JList[Row] = { val session:SparkSession = jc.sparkSession() implicit val hConfig = HbConfig() query(session, tableName, sql, schemasToStructType(schemas)).collectAsList() } private[this] def query(sparkSession: SparkSession, tableName: String, sql: String, schemas: StructType) (implicit config: HbConfig): DataFrame = { val rdd = sparkSession.readHbase(tableName, COLUMN_FAMILY, schemas) val df = sparkSession.createDataFrame(rdd, schemas) df.createOrReplaceTempView(tableName) sparkSession.sql(sql) } }
and the following is my client call:
List<Row> rows = livyClient.submit(job).get();