Hi, Josh: Thanks for your reply. I just added a Jira issue, but I am not familiar with Scala, so I did not add the unit test.
https://issues.apache.org/jira/browse/PHOENIX-3460 Xindian From: Josh Mahonin [mailto:[email protected]] Sent: Friday, November 04, 2016 2:25 PM To: [email protected] Subject: Re: Phoenix Spark plug in cannot find table with a Namespace prefix Hi, Thanks for including the query code and the query exception, it's very helpful. Normally I'd suggest following up with the vendor here, since the namespace support was added in Phoenix 4.8.0, but if everything but phoenix-spark is working with namespaces, I suspect they backported the feature. Could you file a JIRA ticket on the Phoenix project about this? I'm not sure if it should work out of the box or not. If you'd like to try your hand at adding a unit test to verify, you can look at the following places (these are for the schema syntax): https://github.com/apache/phoenix/blob/master/phoenix-spark/src/it/resources/setup.sql#L43 https://github.com/apache/phoenix/blob/master/phoenix-spark/src/it/scala/org/apache/phoenix/spark/PhoenixSparkIT.scala#L407 Thanks, Josh On Thu, Nov 3, 2016 at 4:52 PM, Long, Xindian <[email protected]<mailto:[email protected]>> wrote: I am testing some code using Phoenix Spark plug in to read a Phoenix table with a namespace prefix in the table name (the table is created as a phoenix table not a hbase table), but it returns an TableNotFoundException. The table is obviously there because I can query it using plain phoenix sql through Squirrel, and using spark sql to query has no problem at all. The error log is in the attached file: tableNoFound.txt My testing code is in the attached file: query.java The weird thing is in the attached code, if I run testSpark alone it gives the above exception, but if I run the testJdbc first, and followed by testSpark, both of them work. I am running on the HDP 2.5 platform, with phoenix 4.7.0.2.5.0.0-1245 The problem does not exist at all when I was running the same code on HDP 2.4 cluster, with phoenix 4.4. Neither does the problem occur when I query a table without a namespace prefix in the DB table name, on HDP 2.5 By the way, here is how the HBase looks like when I list it. hbase(main):031:0* list TABLE ACME:ENDPOINT_CONFIG ACME:ENDPOINT_STATUS LONG:ENDPOINTS LONG:RADIOCHANNELS LONG:REGIONINFORMATION LONG:TGBSTATISTICS SENSUS1:ENDPOINTS SENSUS1:RADIOCHANNELS SENSUS1:REGIONINFORMATION SENSUS1:TGBSTATISTICS SENSUS2:ENDPOINTS SENSUS2:RADIOCHANNELS SENSUS2:REGIONINFORMATION SENSUS2:TGBSTATISTICS SENSUS:ENDPOINTS SENSUS:RADIOCHANNELS SENSUS:REGIONINFORMATION SENSUS:TGBSTATISTICS SYSTEM.CATALOG SYSTEM:CATALOG SYSTEM:FUNCTION SYSTEM:SEQUENCE SYSTEM:STATS TENANT 24 row(s) in 0.0090 seconds => ["ACME:ENDPOINT_CONFIG", "ACME:ENDPOINT_STATUS", "LONG:ENDPOINTS", "LONG:RADIOCHANNELS", "LONG:REGIONINFORMATION", "LONG:TGBSTATISTICS", "SENSUS1:ENDPOINTS", "SENSUS1:RADIOCHANNELS", "SENSUS1:REGIONINFORMATION", "SENSUS1:TGBSTATISTICS", "SENSUS2:ENDPOINTS", "SENSUS2:RADIOCHANNELS", "SENSUS2:REGIONINFORMATION", "SENSUS2:TGBSTATISTICS", "SENSUS:ENDPOINTS", "SENSUS:RADIOCHANNELS", "SENSUS:REGIONINFORMATION", "SENSUS:TGBSTATISTICS", "SYSTEM.CATALOG", "SYSTEM:CATALOG", "SYSTEM:FUNCTION", "SYSTEM:SEQUENCE", "SYSTEM:STATS", "TENANT"]
