I have an operation I want to make sure only inserts if there is no row
there.  Typically in hbase proper I would do a checkAndPut with a null
value on the column checked.  So technically if that column was empty the
row would appear to be empty, but under the conditions I have it would be
fine.  So on to my question is there any way to simulate that with Phoenix
or do I have to drop down to low-level API to get it done.

I was trying to configure a query similar to this:

create table foo (
 id varchar not null primary key,
 attr varchar,
 change_key varchar
);

upsert into foo(id, attr, change_key) select '2', 'new', 'blah' from foo
where id='2' and change_key=NULL;

assuming id '2' doesn't exist this wouldn't insert anything.  Generally I
have auto-commit set to true.

thoughts? Seems like a useful feature and something natively supported by
Hbase.

-Dan

-- 
Dan Di Spaltro

Reply via email to