Hello all,
I have a scala script that references a phoenix table called
ENTITY."tableName" including the quotation marks.
When I try to read from the table and load into an RDD via:
val table = """ENTITY."z02""""
val nameCol = "colName"
val rdd: RDD[Map[String, AnyRef]] = sc.phoenixTableAsRDD(
table, Seq(nameCol), zkUrl = Some(zkHost)
)
when I run this I get:
Table undefined. tableName=_ENTITY.tableName
Notice there are no quotes around tableName. When I print the variable in
scala its as expected: ENTITY."z02", so scala understands where the quotes
are in the string.
The read succeeds when running this with dataframes from sqlContext:
val df = sqlContext.read.format("jdbc").options(
Map(
"driver" -> "org.apache.phoenix.jdbc.PhoenixDriver",
"url" -> zkHost,
"dbtable" -> table)).load()
df.show
The above works.
Any insight on why the rdd implementation fails to pass the string along
correctly?
Thanks!