Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Phoenix - Create Table Question

avatar
Contributor

I'm connecting to Phoenix Query Server via the following:

/usr/hdp/current/phoenix-client/bin/sqlline.py hbasemaster:2181:/hbase-unsecure

I'm able successfully connect. I then create a table using:

create table mytable (id varchar not null primary key, mycolumn varchar);

That command seems to run successfully. However, when I try to verify the table exists via:

!tables

I don't see my table listed. When I try to use sql as a verification via:

select * from mytable;

I get a "TableNotFoundException". If I try to create the table again, I get an error that the table already exists. If I look a the HBase Master UI, I can see the table exists in HBase. I'm confused. What am I missing here?

I'm running HDP 2.3.2

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Michael Young

Are you using Phoenix query server? Try accessing table using sqlline.py if you are using pqs

I had same issue with PQS

View solution in original post

16 REPLIES 16

avatar
Master Mentor

@Michael Young

Are you using Phoenix query server? Try accessing table using sqlline.py if you are using pqs

I had same issue with PQS

avatar
Contributor

Yes, I'm suing Phoenix Query Server. /usr/bin/phoenix-sqlline is a symbolic link to /usr/hdp/current/phoenix-client/bin/sqlline.py. That is what I'm using.

avatar
Super Guru

Not relevant to your question, but that's the "normal" (thick) Phoenix driver. The "thin" Phoenix driver (with Phoenix QueryServer) is accessed using sqlline-thin.py.

avatar
Contributor

What is the difference between the thick and thin driver in terms of what I'm trying to do? When I use phoenix-sqlline-thin it shows the table now which is puzzling to me. Why the difference in behavior?

avatar
Master Mentor

@Michael Young @Josh Elser I think it has to do with zk

shutdown hbase and RS and run this

hbase clean --cleanZk

avatar
Super Guru

The "thick" Phoenix driver does all the RPC with HBase directly. The "thin" Phoenix driver only communicates with the Phoenix QueryServer over HTTP (the QueryServer communicates to HBase on its behalf). You shouldn't see any differences between the two approaches.

avatar
Contributor
@Neeraj Sabharwal

Good catch! Running "hbase clean --cleanZk" fixed the problem. Now the thick and thin client are working similarly.

avatar
Master Mentor

@Michael Young Thanks for testing. I believe we have the answer 😉

Thanks @Josh Elser for chiming in ...Really appreciate it!!!! All comments upvote

avatar
Contributor

@Josh Elser

Thank you for the clarification regarding the clients. I didn't expect to see difference in terms of how the sql worked. Using the thin client did help to identify there was a difference between the two.