0

I am beginner in using Phoenix as well as HBase.

I am unable to use UPSERT statements of phoenix with column family name for dynamic columns.

My create table statement :

CREATE TABLE TEST(
A UNSIGNED_LONG NOT NULL,
B VARCHAR NOT null,
C UNSIGNED_LONG NOT null,
CONSTRAINT rowkey PRIMARY KEY(A,B,C)
)

My upsert STATEMENT:

UPSERT INTO TEST(A,B,C,d.D INTEGER,d.E INTEGER,e.F INTEGER) VALUES (30000,alice,200000,1,1,1)

Error Message :

ERROR 1001 (42I01): Undefined column family. familyName=D.null

What am I missing here?

pheeleeppoo
  • 1,491
  • 6
  • 25
  • 29
Blank
  • 81
  • 11

1 Answers1

0

I was just studying this piece of phoenix.Maybe you can review this url

http://phoenix.apache.org/dynamic_columns.html

for your question,the problem here should be: you did not define an column family "d" but you used it in upsert and you even used two column family(the "e").In the create table scripts you should at least define an column family "d"(i know there is a default column family "0" if you did not define),phoenix can support dynamic columns insert but i am not sure it can support dynamic column family insert.So i think the code should be:

CREATE TABLE TEST(
A UNSIGNED_LONG NOT NULL,
B VARCHAR NOT null,
C UNSIGNED_LONG NOT null,
"d".D integer
CONSTRAINT rowkey PRIMARY KEY(A,B,C)
)

and you can upsert like this:

UPSERT INTO TEST(A,B,C,"d".D,"d".E INTEGER,"d".f INTEGER) VALUES (30000,'alice',200000,1,1,1);

I test it works.

D.Alex
  • 16
  • 3