You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Jose M <so...@hotmail.com> on 2015/06/30 01:38:03 UTC
Avoid deleting Hbase table when droping table with Phoenix
Hi,
I'm new to Phoenix and trying it right now. I had installed it as Parcel in Cloudera 5.4.
I'm planning to use it with an already existant Hbase table (other systems use it and I can't recreate it). I see that I can create it without problem with the CREATE TABLE command.
But in case I need to DROP the table afterwards (only from Phoenix), is there any way to avoid removing the table also from Hbase? Cause I tried the DROP TABLE command and the table is removed despite setting the phoenix.schema.dropMetaData property in Phoenix hbase-site.xml with true or false.
I'm using Phoenix from command line (/opt/cloudera/parcels/CLABS_PHOENIX-4.3.0-1.clabs_phoenix1.0.0.p0.78/lib/phoenix/bin/sqlline.py) and I set the property in /opt/cloudera/parcels/CLABS_PHOENIX-4.3.0-1.clabs_phoenix1.0.0.p0.78/lib/phoenix/bin/hbase-site.xml.
I also see that Phoenix add an extra column (named _0) with an empty value in my column family. Is there any way to avoid that?
Thanks in advance,
Re: Avoid deleting Hbase table when droping table with Phoenix
Posted by James Taylor <ja...@apache.org>.
You can avoid the creation of the empty value and avoid data being dropped
by using the CREATE VIEW command instead of creating a table. Follow the
link that Thomas posted to see some of the trade-offs between a view versus
table. The main one is that a view is read-only and don't support secondary
indexing.
On Mon, Jun 29, 2015 at 4:41 PM, Thomas D'Silva <td...@salesforce.com>
wrote:
> Jose,
>
> hbase-site.xml needs to be on the classpath in order for the config to
> get picked up.
> Regarding the empty key value see :
>
> https://groups.google.com/forum/#!msg/phoenix-hbase-user/UWdBghSfePo/BmCxOUOPHn8J
>
> -Thomas
>
> On Mon, Jun 29, 2015 at 4:38 PM, Jose M <so...@hotmail.com> wrote:
> > Hi,
> > I'm new to Phoenix and trying it right now. I had installed it as Parcel
> in
> > Cloudera 5.4.
> >
> > I'm planning to use it with an already existant Hbase table (other
> systems
> > use it and I can't recreate it). I see that I can create it without
> problem
> > with the CREATE TABLE command.
> >
> > But in case I need to DROP the table afterwards (only from Phoenix), is
> > there any way to avoid removing the table also from Hbase? Cause I tried
> the
> > DROP TABLE command and the table is removed despite setting the
> > phoenix.schema.dropMetaData property in Phoenix hbase-site.xml with true
> or
> > false.
> > I'm using Phoenix from command line
> >
> (/opt/cloudera/parcels/CLABS_PHOENIX-4.3.0-1.clabs_phoenix1.0.0.p0.78/lib/phoenix/bin/sqlline.py)
> > and I set the property in
> >
> /opt/cloudera/parcels/CLABS_PHOENIX-4.3.0-1.clabs_phoenix1.0.0.p0.78/lib/phoenix/bin/hbase-site.xml.
> >
> > I also see that Phoenix add an extra column (named _0) with an empty
> value
> > in my column family. Is there any way to avoid that?
> >
> > Thanks in advance,
> >
> >
>
RE: Avoid deleting Hbase table when droping table with Phoenix
Posted by Jose M <so...@hotmail.com>.
Hi Thomas (and James), thank you both.
Regarding hbase-site.xml, i think it's being picked up, cause first when I tried to create the table I have a timeout error and after adding in that file the property phoenix.query.timeoutMs with a higher timeout, i manage to create the table. Do I have to add the property to Hbase through Cloudera Manager?
Or maybe I understand wrong and phoenix.schema.dropMetaData will drop the table despite it's value?
James says that in the link there are some trade-offs between a view versus table, but I don't see any mention about that.
So to avoid the empty key value, the only way is using a view instead of a table? I don't have any use case where all key value columns could be set to null (so rows won't disappear), nor will have schemas that only include row key columns.
Thanks in advance!
> Date: Mon, 29 Jun 2015 16:41:51 -0700
> Subject: Re: Avoid deleting Hbase table when droping table with Phoenix
> From: tdsilva@salesforce.com
> To: user@phoenix.apache.org
>
> Jose,
>
> hbase-site.xml needs to be on the classpath in order for the config to
> get picked up.
> Regarding the empty key value see :
> https://groups.google.com/forum/#!msg/phoenix-hbase-user/UWdBghSfePo/BmCxOUOPHn8J
>
> -Thomas
>
> On Mon, Jun 29, 2015 at 4:38 PM, Jose M <so...@hotmail.com> wrote:
> > Hi,
> > I'm new to Phoenix and trying it right now. I had installed it as Parcel in
> > Cloudera 5.4.
> >
> > I'm planning to use it with an already existant Hbase table (other systems
> > use it and I can't recreate it). I see that I can create it without problem
> > with the CREATE TABLE command.
> >
> > But in case I need to DROP the table afterwards (only from Phoenix), is
> > there any way to avoid removing the table also from Hbase? Cause I tried the
> > DROP TABLE command and the table is removed despite setting the
> > phoenix.schema.dropMetaData property in Phoenix hbase-site.xml with true or
> > false.
> > I'm using Phoenix from command line
> > (/opt/cloudera/parcels/CLABS_PHOENIX-4.3.0-1.clabs_phoenix1.0.0.p0.78/lib/phoenix/bin/sqlline.py)
> > and I set the property in
> > /opt/cloudera/parcels/CLABS_PHOENIX-4.3.0-1.clabs_phoenix1.0.0.p0.78/lib/phoenix/bin/hbase-site.xml.
> >
> > I also see that Phoenix add an extra column (named _0) with an empty value
> > in my column family. Is there any way to avoid that?
> >
> > Thanks in advance,
> >
> >
Re: Avoid deleting Hbase table when droping table with Phoenix
Posted by Thomas D'Silva <td...@salesforce.com>.
Jose,
hbase-site.xml needs to be on the classpath in order for the config to
get picked up.
Regarding the empty key value see :
https://groups.google.com/forum/#!msg/phoenix-hbase-user/UWdBghSfePo/BmCxOUOPHn8J
-Thomas
On Mon, Jun 29, 2015 at 4:38 PM, Jose M <so...@hotmail.com> wrote:
> Hi,
> I'm new to Phoenix and trying it right now. I had installed it as Parcel in
> Cloudera 5.4.
>
> I'm planning to use it with an already existant Hbase table (other systems
> use it and I can't recreate it). I see that I can create it without problem
> with the CREATE TABLE command.
>
> But in case I need to DROP the table afterwards (only from Phoenix), is
> there any way to avoid removing the table also from Hbase? Cause I tried the
> DROP TABLE command and the table is removed despite setting the
> phoenix.schema.dropMetaData property in Phoenix hbase-site.xml with true or
> false.
> I'm using Phoenix from command line
> (/opt/cloudera/parcels/CLABS_PHOENIX-4.3.0-1.clabs_phoenix1.0.0.p0.78/lib/phoenix/bin/sqlline.py)
> and I set the property in
> /opt/cloudera/parcels/CLABS_PHOENIX-4.3.0-1.clabs_phoenix1.0.0.p0.78/lib/phoenix/bin/hbase-site.xml.
>
> I also see that Phoenix add an extra column (named _0) with an empty value
> in my column family. Is there any way to avoid that?
>
> Thanks in advance,
>
>