回覆列表
  • 1 # 使用者1208090662578

    val hbaseData = hBaseRDD.map ( result => {

    //獲取rowkey

    val rowkey = Bytes.toString(result._2.getRow)

    //透過列族和列名獲取列

    val typeId = Bytes.toString(result._2.getValue(Bytes.toBytes("列簇名"),Bytes.toBytes("欄位名")))

    val typeValue = Bytes.toString(result._2.getValue(Bytes.toBytes("TA"),Bytes.toBytes("value")))

    (rowkey,typeValue)

    }).toDF("rowkey","typeValue")

    hbaseData.registerTempTable("table")

    val frame = sqlContext.sql("select * from table".stripMargin).show()

  • 中秋節和大豐收的關聯?
  • 木芙蓉花的詩句?