I am following spark hbase connector basic example to read a HBase table in spark2 shell version 2.2.0. It looks like the code is working, but when I run df.show() command, I do not see any results and it seems to run forever.
import org.apache.spark.sql.{ DataFrame, Row, SQLContext }
import org.apache.spark.sql.execution.datasources.hbase._
val sqlContext = new org.apache.spark.sql.SQLContext(sc);
def catalog = s"""{
|"table":{"namespace":"default", "name":"testmeta"},
|"rowkey":"vgil",
|"columns":{
|"id":{"cf":"rowkey", "col":"vgil", "type":"string"},
|"col1":{"cf":"pp", "col":"dtyp", "type":"string"}
|}
|}""".stripMargin
def withCatalog(cat: String): DataFrame = { sqlContext.read.options(Map(HBaseTableCatalog.tableCatalog->cat)).format("org.apache.spark.sql.execution.datasources.hbase").load()}
val df = withCatalog(catalog)
df.show()
df.show() will neither give any output nor any error. It will keep on running forever.
Also, how can I run queryy for range of row keys.
Here is the scan of the HBase test table.
hbase(main):001:0> scan 'testmeta'
ROW COLUMN+CELL
fmix column=pp:dtyp, timestamp=1541714925380, value=ss1
fmix column=pp:lati, timestamp=1541714925371, value=41.50
fmix column=pp:long, timestamp=1541714925374, value=-81.61
fmix column=pp:modm, timestamp=1541714925377, value=ABC
vgil column=pp:dtyp, timestamp=1541714925405, value=ss2
vgil column=pp:lati, timestamp=1541714925397, value=41.50
I have followed some of solutions on the web, but unfortunately not able to get the data from HBase.
Thanks in advance for help!