Support Questions
Find answers, ask questions, and share your expertise

Phoenix - Table

I have created a table with few CF and initial list of qualifiers. Later on while UPSERTing data into the table with dynamic qualifiers, it was successfully added. But I am not able to view them anymore.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------

CREATE TABLE IF NOT EXISTS EMPDETAIL (id bigint not null, name varchar(255) not null, age bigint, address.addr1 varchar(1000), address.addr2 varchar(1000), address.addr3 varchar(1000), CONSTRAINT EMPDETAIL_PK PRIMARY KEY (id,name))

UPSERT INTO EMPDETAIL (id, name, age, address.addr1, address.addr2, address.addr3) VALUES (1, 'Test1', 20, 'testaddr1', 'testaddr2', 'testaddr3')

UPSERT INTO EMPDETAIL (id, name, age, address.addr1, address.addr2, address.addr3, address.addr4 varchar(1000)) VALUES (2, 'Test2', 220, 'testaddr11', 'testaddr22', 'testaddr33', 'testaddr44')

UPSERT INTO EMPDETAIL (id, name, age, address.addr1, address.addr2, address.addr3, address.addr4 varchar(1000)) VALUES (3, 'Test3', 330, 'testaddr33', 'testaddr33', 'testaddr333', 'testaddr444')

---------------------------------------------------------------------------------------------------------------------------------------------------------------------

If I execute "SELECT * FROM EMPDETAIL", it doesn't return address.add4.

I am using "Aqua Data Studio" to connect to Hbase using Phoenix & Hbase client jars.

1 REPLY 1

Hi, @rudra prasad biswas,

"select * from myTable" in Phoenix will only return columns defined in the table DDL. To include dynamic columns in query results, you must explicitly include them in the select clause. See the docs for an example.

This is where views come in handy. Instead of manually defining dynamic columns in each query, you can define them once in a view, then select * from myView.