0

I have been trying to insert List of Records into HBase using HBase client library. it works for a single Put in either Table or HTable(deprecated) but does not recognize List(Puts) Error Says: Expected: util.List, but was List

Could not understand the meaning of this error. Tried converting to JavaList but did not succeed.

Any quick advice would be higher appreciable. `

  val quoteRecords = new ListBuffer[Put]()
  val listQuotes = lines.foreachRDD(rdd => {
      rdd.foreach(record => addPutToList(buildPut(record)))
   })

  table.put(quoteRecords.toList)
  quoteRecords.foreach(table.put)
  println(listQuotes)

`

RamRapolu
  • 1
  • 5
  • `util.List` means `java.util.List`, which is not a Scala `List`. Where did you try to convert? Did you import the implicit conversions? – OneCricketeer Mar 07 '17 at 23:12

1 Answers1

0

listQuotes.toList returns a type of a scala.List. You have to convert that into a java.util.List type. this sof thread will give you some insight.

Community
  • 1
  • 1
Yohannes Gebremariam
  • 2,225
  • 3
  • 17
  • 23