-1

I have an existing HBase table, and I'm using phoenix-sqlline.

I added 2 new columns(let's call them A and B) to the existing table, and they have NULL values as of now.

I want to update these 2 columns to a value (let's say A to 1.0 and B to 0.1) without any condition.

How can I do it using phoenix sqlline?

Note: There's this one way to read the data from HBase tables in Spark dataframe, and manipulate the data, and re-write it back, but I want to avoid that way.

I tried UPSERT specifying only one column, but didn't seem to work.

Thanks

pri
  • 1,521
  • 2
  • 13
  • 26

1 Answers1

0

Did you try UPSERT SELECT?

Example:

UPSERT INTO YOUR_TABLE(PRIMARY_KEY, A, B)
SELECT PRIMARY_KEY, 1.0, 0.1 FROM YOUR_TABLE
WHERE <condition>;

It would be helpful if you could provide the upsert command you used.