phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ankit Singhal <ankitsingha...@gmail.com>
Subject Re: Phoenix Spark plug in cannot find table with a Namespace prefix
Date Fri, 30 Dec 2016 05:56:27 GMT
Hi Long,


Is the table name provided at the time of creation is without double
quotes? if yes, then you should be running your queries having a table name
without double quotes and a dot between schema and table.

like this: - Select ENDPOINT_ID, CITY from *ACME.ENDPOINT_STATUS* Where
city = 'ACME City'


If above is not the case, then can you share the dump of SYSTEM.CATALOG and
SYSTEM:CATALOG table( by running scan from hbase shell). and confirm if you
have reverted any namespace property.

org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03):
Table undefined. tableName=ACME:ENDPOINT_STATUS
	at org.apache.phoenix.schema.PMetaDataImpl.getTableRef(PMetaDataImpl.java:265)
	at org.apache.phoenix.jdbc.PhoenixConnection.getTable(PhoenixConnection.java:449)
	at org.apache.phoenix.util.PhoenixRuntime.getTable(PhoenixRuntime.java:407)
	at org.apache.phoenix.util.PhoenixRuntime.generateColumnInfo(PhoenixRuntime.java:433)
	at


Regards,

Ankit Singhal.




On Mon, Nov 7, 2016 at 11:38 PM, Long, Xindian <Xindian.Long@sensus.com>
wrote:

> 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:jmahonin@gmail.com]
> *Sent:* Friday, November 04, 2016 2:25 PM
> *To:* user@phoenix.apache.org
> *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 <Xindian.Long@sensus.com>
> 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"]*
>
>
>
>
>
>
>

Mime
View raw message