You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Hafiz Mujadid <ha...@gmail.com> on 2015/09/11 06:48:26 UTC

Renaming a column in phoenix

Hi All!

I want to rename a column in phoenix with hbase. Similarly what If i want
to change
the type of a column, what will be the effect of altering column type on
existing data?

Thanks

Re: Renaming a column in phoenix

Posted by Gabriel Reid <ga...@gmail.com>.
There isn't a command available to rename or change the data type of a
column in Phoenix -- to do something like this, you need to drop a
column and then create a new column.

If you have existing data that you want to migrate, I would suggest
doing the following:
1. Create the new column (with the new name and possibly new type)
2. Run an UPSERT SELECT statement to copy/migrate data from the old
column to the new column
3. Drop the old column

- Gabriel


On Fri, Sep 11, 2015 at 6:48 AM, Hafiz Mujadid <ha...@gmail.com> wrote:
> Hi All!
>
> I want to rename a column in phoenix with hbase. Similarly what If i want to
> change
> the type of a column, what will be the effect of altering column type on
> existing data?
>
> Thanks