Uploaded image for project: 'Livy'
  1. Livy
  2. LIVY-321

LivyClient comes out NullPointException while return spark-sql result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.3, 0.4.0
    • 0.9.0
    • API, RSC
    • None
    • spark version : 2.0.1
      livy: 0.4.0.SNAPSHOT
      hbase:1.2.1
      hadoop:2.7.3

    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();
      

      Attachments

        1. livy-server log.png
          178 kB
          Alex Bozarth
        2. client-log.png
          91 kB
          Alex Bozarth
        3. spark web ui.png
          32 kB
          Alex Bozarth

        Activity

          People

            Unassigned Unassigned
            zzzhy zzzhy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: