Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Phoenix 4.7: Read Phoenix Views by SparkSQL

Highlighted

Phoenix 4.7: Read Phoenix Views by SparkSQL

Expert Contributor

Is it possible to read the data of a Phoenix View by SparkSQL?

I'm doing something like this:

// HBase Shell
create 'hbase_table', { NAME => 'cf1' } put 'hbase_table', ... // Afterwards, e.g. in Zeppelin %jdbc(phoenix) CREATE VIEW "hbase_table" ( rowkey VARCHAR PRIMARY KEY, "cf"."col" VARCHAR) // Afterwards
%spark
val df = sqlContext.read.format("jdbc").options(Map("driver" -> "org.apache.phoenix.jdbc.PhoenixDriver","url" -> "jdbc:phoenix:myhost:2181:/hbase-unsecure", "dbtable" -> "hbase_table")).load()

The property dbtable seems to be a mandatory one... So are there only Phoenix Tables supported or can I also give it a Phoenix View somehow? Thank you!