Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

hbase with phoenix: upsert 'new value' to existing null column doesn't have any effect

avatar
New Contributor

Hello everybody,

I'm facing with a very weird behaviour with an UPSERT instruction: the operation doesn't have effect on columns that was previously stored with null value;

 

I have 'tab1' defined as

 

create table IF NOT EXISTS tab1(id VARCHAR not null, eventdate TIMESTAMP not null, category VARCHAR, history VARBINARY);

 

UPSERT into tab1(id,eventdate,category,history) values ('id1',to_timestamp('2022-10-20 00:00:00.0','test',null);

 

now I just try to execute the following statement:

UPSERT into tab1(id,eventdate,category,history) values ('id1',to_timestamp('2022-10-20 00:00:00.0','edited test','ABC');

 

this is the resulting table:

SELECT * FROM tab1

+-----+-----------------------+-------------+---------+

| id  |        eventdate      |  category   | history |

+-----+-----------------------+-------------+---------+

| id1 | 2022-10-20 00:00:00.0 | edited test |         |

+-----+-----------------------+-------------+---------+

 

I've tryied many times and in different way (upserting from select, upserting different values) but anything doesn't works and 'history' column keep his original "null value"

 

does it depends on some property/configuration/anything?

can anybody help me to solve this issue?

 

I've also found a different 3d on this forum, but the answer doesn't give me any help

( https://community.cloudera.com/t5/Support-Questions/Apache-Phoenix-Upsert-not-working-while-trying-t... )

 

thank you all

 

UPDATE: this issue is present only on some records, I've tried the UPSERT on some other "fake" records and the statement works perfectly!

2 REPLIES 2

avatar
New Contributor

up

avatar
Contributor

Hi,

This a BUG from Phoenix 

if I use upsert with null value, it "insert" the field with 0x00 0x00 bytes values and we cannot change

 

https://issues.apache.org/jira/browse/PHOENIX-6583

 

Please check the above BUG jira