From user-return-523-apmail-phoenix-user-archive=phoenix.apache.org@phoenix.incubator.apache.org Wed Apr 9 20:11:27 2014 Return-Path: X-Original-To: apmail-phoenix-user-archive@minotaur.apache.org Delivered-To: apmail-phoenix-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4E1D711C0C for ; Wed, 9 Apr 2014 20:11:27 +0000 (UTC) Received: (qmail 63504 invoked by uid 500); 9 Apr 2014 20:11:26 -0000 Delivered-To: apmail-phoenix-user-archive@phoenix.apache.org Received: (qmail 63377 invoked by uid 500); 9 Apr 2014 20:11:25 -0000 Mailing-List: contact user-help@phoenix.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@phoenix.incubator.apache.org Delivered-To: mailing list user@phoenix.incubator.apache.org Received: (qmail 63364 invoked by uid 99); 9 Apr 2014 20:11:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2014 20:11:24 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kleiton.contato@gmail.com designates 209.85.213.52 as permitted sender) Received: from [209.85.213.52] (HELO mail-yh0-f52.google.com) (209.85.213.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2014 20:11:19 +0000 Received: by mail-yh0-f52.google.com with SMTP id c41so2888838yho.39 for ; Wed, 09 Apr 2014 13:10:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=U65JmruJHBoqFUK9PLJRxfWE6rEnUbvYkTXK79SWboc=; b=Doj3eteuAqXrbwOgFm9X2asScdYKB/9ouHJ7qjkg/FymvsR1L+iOakbTU4Kd1zH221 oXobMFsOG7HnTonLlpS1emzMPZxzEbV3h1RsEdEzvJVmefL+uxlO3UX4uCxrvSwQeRrf tI4s7BldPZc2k4jy8dg20dYtkkXwW5dQbT14aeH1tzTepzq1kiHH43U9SFqiVPQmTl2r 99F4IbVQztz4Umore/uIFnRqQKmXIxgw+woaAqsJwW1XcdbMptUOpxjKEwu9rlN1q2ei zt/hy+lIbfcecFZ4VOvxDdwok3OnXyB69nsO0ahzwoaUQZ3XIKv02GF/3XaxdFg3CuGZ KEBA== MIME-Version: 1.0 X-Received: by 10.236.172.166 with SMTP id t26mr2816942yhl.136.1397074256519; Wed, 09 Apr 2014 13:10:56 -0700 (PDT) Received: by 10.170.76.130 with HTTP; Wed, 9 Apr 2014 13:10:56 -0700 (PDT) In-Reply-To: References: <74ECFFA8DC3B6847888649793C770FE06E5476B7@szxeml559-mbx.china.huawei.com> <22d88a44cf994c97b37b612e23d4bd47@MERCMBX36D.na.SAS.com> <74ECFFA8DC3B6847888649793C770FE06E548A29@szxeml559-mbx.china.huawei.com> Date: Wed, 9 Apr 2014 13:10:56 -0700 Message-ID: Subject: Re: Basic mapping to HBase table From: Kleiton Silva To: user@phoenix.incubator.apache.org Content-Type: multipart/alternative; boundary=20cf30434c34c8e6d604f6a1b2ae X-Virus-Checked: Checked by ClamAV on apache.org --20cf30434c34c8e6d604f6a1b2ae Content-Type: text/plain; charset=ISO-8859-1 That's great, Thank you. Atte, On Wed, Apr 9, 2014 at 12:55 PM, Ravi Kiran wrote: > Hi > > You can override the behavior by setting the property * > phoenix.schema.dropMetaData* to FALSE. For further reading, > http://phoenix.incubator.apache.org/language/index.html#drop_table. > > Regards > Ravi > > > On Thu, Apr 10, 2014 at 1:06 AM, Kleiton Silva wrote: > >> Another question, in this case is possible drop table without delete >> table in Hbase? >> >> Thank you >> >> Atte., >> >> >> On Wed, Apr 9, 2014 at 11:57 AM, Kleiton Silva > > wrote: >> >>> It's work. >>> >>> Result >>> >>> PK a b c >>> row1 value1 row2 value2 row3 >>> >>> value3 >>> >>> Thank you very much Jerry. >>> >>> Kleiton >>> >>> >>> >>> >>> On Wed, Apr 9, 2014 at 10:12 AM, Jerry Lam wrote: >>> >>>> you can try: >>>> >>>> CREATE table "test" ( pk VARCHAR PRIMARY KEY, "cf"."a" VARCHAR, , >>>> "cf"."b" VARCHAR, "cf"."c" VARCHAR ); >>>> >>>> >>>> >>>> On Wed, Apr 9, 2014 at 12:40 PM, Kleiton Silva < >>>> kleiton.contato@gmail.com> wrote: >>>> >>>>> Firas, >>>>> >>>>> I have the follow table in hbase: >>>>> >>>>> hbase(main):032:0> scan 'test' >>>>> ROW COLUMN+CELL >>>>> >>>>> row1 column=cf:a, timestamp=1397068853016, >>>>> value=value1 >>>>> row2 column=cf:b, timestamp=1397068857098, >>>>> value=value2 >>>>> row3 column=cf:c, timestamp=1397068861755, >>>>> value=value3 >>>>> >>>>> >>>>> When a try to create table using Phoenix, use the command: >>>>> >>>>> CREATE table "test" ( pk VARCHAR PRIMARY KEY, "cf"."val" VARCHAR ); >>>>> >>>>> >>>>> The result is : >>>>> >>>>> *PK* * val* >>>>> row1 row2 row3 >>>>> >>>>> Could you help me? >>>>> >>>>> Thank you. >>>>> >>>>> Kleiton >>>>> >>>>> >>>>> On Tue, Apr 8, 2014 at 6:19 AM, Firas Khasawneh < >>>>> Firas.Khasawneh@sas.com> wrote: >>>>> >>>>>> Thanks Pankaj! >>>>>> >>>>>> >>>>>> >>>>>> *From:* Pankaj kr [mailto:pankaj.kr@huawei.com] >>>>>> *Sent:* Tuesday, April 08, 2014 12:50 AM >>>>>> >>>>>> *To:* user@phoenix.incubator.apache.org >>>>>> *Subject:* RE: Basic mapping to HBase table >>>>>> >>>>>> >>>>>> >>>>>> Hi Firas, >>>>>> >>>>>> >>>>>> >>>>>> Phoenix doesn't work with Accumulo. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Kindly check the below link for more details, >>>>>> >>>>>> http://phoenix.incubator.apache.org/ >>>>>> >>>>>> Cheers, >>>>>> >>>>>> Pankaj >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> *From:* Firas Khasawneh [mailto:Firas.Khasawneh@sas.com] >>>>>> >>>>>> *Sent:* 07 April 2014 20:46 >>>>>> *To:* user@phoenix.incubator.apache.org >>>>>> *Subject:* RE: Basic mapping to HBase table >>>>>> >>>>>> >>>>>> >>>>>> Hi all, >>>>>> >>>>>> >>>>>> >>>>>> Does phoenix work only with HBase or does it also work with Accumulo? >>>>>> >>>>>> >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Firas >>>>>> >>>>>> >>>>>> >>>>>> *From:* Pankaj kr [mailto:pankaj.kr@huawei.com ] >>>>>> >>>>>> *Sent:* Monday, April 07, 2014 9:15 AM >>>>>> *To:* user@phoenix.incubator.apache.org >>>>>> *Subject:* RE: Basic mapping to HBase table >>>>>> >>>>>> >>>>>> >>>>>> Hi Daniel, >>>>>> >>>>>> >>>>>> >>>>>> You mapped the HBase table using the below statement, >>>>>> >>>>>> CREATE VIEW "t1" ( pk >>>>>> VARCHAR PRIMARY KEY, "f1".val VARCHAR ); >>>>>> >>>>>> By default, Phoenix sends characters in capital >>>>>> letter, so here second column of view is mapped to the qualifier "f1:VAL". >>>>>> >>>>>> >>>>>> >>>>>> But you inserted records at HBase in "f1:val" instead of "f1:VAL" as, >>>>>> >>>>>> r1 column=f1:val, timestamp=1396558762590, value=a >>>>>> >>>>>> >>>>>> >>>>>> So NULL value is displayed in VAL column at Phoenix >>>>>> side. >>>>>> >>>>>> >>>>>> >>>>>> You can map as "f1"."val" to resolve this or insert records in >>>>>> "f1:VAL". >>>>>> >>>>>> >>>>>> >>>>>> Cheers, >>>>>> >>>>>> Pankaj >>>>>> >>>>>> >>>>>> >>>>>> *From:* Daniel Rodriguez [mailto:df.rodriguez143@gmail.com] >>>>>> >>>>>> *Sent:* 04 April 2014 06:18 >>>>>> *To:* user >>>>>> *Subject:* Basic mapping to HBase table >>>>>> >>>>>> >>>>>> >>>>>> Hi all, >>>>>> >>>>>> >>>>>> >>>>>> I spent a couple of hours today trying phoenix for the first time, >>>>>> looks amazing. >>>>>> >>>>>> >>>>>> >>>>>> My final objective is to do SQL on a big hbase table that has a >>>>>> composite key, i decided to start slow and I was able to create a table on >>>>>> phoenix, upsert values and see them on hbase, but I am not able to do the >>>>>> oposite: map (using a view) values on an existing hbase to a phoenix table, >>>>>> i am always getting "null" values. >>>>>> >>>>>> >>>>>> >>>>>> Here is a basic example copied from the docs: >>>>>> >>>>>> >>>>>> >>>>>> HBASE: >>>>>> >>>>>> > create 't1', {NAME => 'f1', VERSIONS => 5} >>>>>> >>>>>> >>>>>> >>>>>> PHOENIX: >>>>>> >>>>>> > CREATE VIEW "t1" ( pk VARCHAR PRIMARY KEY, "f1".val VARCHAR ); >>>>>> > select * from "t1"; >>>>>> +------------+------------+ >>>>>> | PK | VAL | >>>>>> +------------+------------+ >>>>>> +------------+------------+ >>>>>> >>>>>> >>>>>> >>>>>> Works fine since there is no data. >>>>>> >>>>>> >>>>>> >>>>>> I add data to hbase: >>>>>> >>>>>> > put 't1,'r1','f1','a' >>>>>> >>>>>> > scan 't1' >>>>>> >>>>>> ROW COLUMN+CELL >>>>>> >>>>>> r1 column=f1:, >>>>>> timestamp=1396558806334, value=a >>>>>> >>>>>> >>>>>> >>>>>> But if i try to select from phoenix i get only null values.: >>>>>> >>>>>> > select * from "t1"; >>>>>> >>>>>> +------------+------------+ >>>>>> >>>>>> | PK | VAL | >>>>>> >>>>>> +------------+------------+ >>>>>> >>>>>> | r1 | null | >>>>>> >>>>>> +------------+------------+ >>>>>> >>>>>> >>>>>> >>>>>> I also tried to save it on an specific column in the column family: >>>>>> >>>>>> >>>>>> >>>>>> > scan 't1' >>>>>> >>>>>> ROW COLUMN+CELL >>>>>> >>>>>> r1 column=f1:, >>>>>> timestamp=1396558806334, value=a >>>>>> >>>>>> r1 column=f1:val, >>>>>> timestamp=1396558762590, value=a >>>>>> >>>>>> >>>>>> >>>>>> I also tried to change from varchar to integer and insert numbers but >>>>>> i got the same result in both cases. >>>>>> >>>>>> >>>>>> >>>>>> I am using phoenix 2.2.0 on EMR. >>>>>> >>>>>> >>>>>> >>>>>> Any help you can give me is appreciated. >>>>>> >>>>>> >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Daniel >>>>>> >>>>> >>>>> >>>> >>> >> > --20cf30434c34c8e6d604f6a1b2ae Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
That's great, 

Thank you.

Atte,


On Wed, Apr 9, 2014 at 12:55 PM, Ravi Kiran <maghamravikiran@gmail.com> wrote:
Hi

   You can override the behavior by setting the property phoe= nix.schema.dropMetaData to FALSE. For further reading, http://phoenix.incubator.apache.org/language/index.html#drop_table.

Regards
Ravi


On Thu, Apr 10, 2014 at 1:0= 6 AM, Kleiton Silva <kleiton.contato@gmail.com> wrot= e:
Another question, in this c= ase is possible drop table without delete table in Hbase?

Thank you

Atte.,


On Wed, Apr 9, 2014 at 11:57 AM, Kleiton Silva <kleiton.contato@gm= ail.com> wrote:
It's work.

Result

 PK      a         b   &= nbsp;      c
row1 value1
row2 value2
row3

value3


Thank you very much Jerry.

Kleiton




On Wed, = Apr 9, 2014 at 10:12 AM, Jerry Lam <chilinglam@gmail.com>= wrote:
you can try:

=
CREATE table "test" ( pk VARCHAR PRIMARY KEY, "cf"= ;.”a” VARCHAR, , "cf".”b” VA= RCHAR, "cf".”c” VARCHAR );<= /span>



On Wed, Apr 9, 2014 at 12:40 PM, Kleiton Silva <kleiton.contato@gmail.com> wrote:
Firas, 

=
I have the follow table in hbase:

hbase(= main):032:0> scan 'test'
ROW                   &nb= sp;  COLUMN+CELL               &nbs= p;                     &n= bsp;                   
 row1                 &nb= sp;  column=3Dcf:a, timestamp=3D1397068853016, value=3Dvalue1   &= nbsp;              
 row2=                    colum= n=3Dcf:b, timestamp=3D1397068857098, value=3Dvalue2       &n= bsp;          
 row3     =                column=3Dcf:c, times= tamp=3D1397068861755, value=3Dvalue3


When a try to create table using P= hoenix, use the command:

 CREATE table "= test" ( pk VARCHAR PRIMARY KEY, "cf".”val” VARCH= AR );


The result is :

PK           val
row1        <null> row2        <null> row3         <null>

Could you hel= p me?

Thank you.

Kleiton


On Tue, = Apr 8, 2014 at 6:19 AM, Firas Khasawneh <Firas.Khasawneh@sas.com= > wrote:

Thanks Pankaj!<= /u>

 

From: Pankaj= kr [mailto:panka= j.kr@huawei.com]
Sent: Tuesday, April 08, 2014 12:50 AM


To: user@phoenix.incubator.apache.org
Subject: RE: Basic mapping to HBase table
<= p>

 

Hi Firas,

 

    &= nbsp;           Phoenix d= oesn’t work with Accumulo.  

http://phoenix.incubator.apache.org/

Cheers,

Pankaj

 

 

From: Firas Kh= asawneh [mailt= o:Firas.Khasawneh@sas.com]
Sent: 07 April 2014 20:46
To: user@phoenix.incubator.apache.org
Subject: RE: Basic mapping to HBase table

 

Hi all,

 

Does phoenix work only wi= th HBase or does it also work with Accumulo?

 

Thanks,

Firas

 

From: Pankaj= kr [mailto:panka= j.kr@huawei.com]
Sent: Monday, April 07, 2014 9:15 AM
To: user@phoenix.incubator.apache.org
Subject: RE: Basic mapping to HBase table

 

Hi Daniel,<= /span>

 

    &= nbsp;           You mappe= d the HBase table using the below statement,

    &= nbsp;            &nb= sp;            =          CREATE VIEW "= ;t1" ( pk VARCHAR PRIMARY KEY, "f1".val VARCHAR );

    &= nbsp;           By defaul= t, Phoenix sends characters in capital letter, so here second column of vie= w is mapped to the qualifier “f1:VAL”.

r1   col= umn=3Df1:val, timestamp=3D1396558762590, value=3Da

 

    &= nbsp;           So NULL v= alue is displayed in VAL column at Phoenix side.  

 

"f1".”val” to resolve this or insert records in “f1:V= AL”.

 

Cheers,

Pankaj 

 

From: Daniel R= odriguez [ma= ilto:df.rodriguez143@gmail.com]
Sent: 04 April 2014 06:18
To: user
Subject: Basic mapping to HBase table

 

Hi all,

 

I spent a couple of hours today trying ph= oenix for the first time, looks amazing.

 

My final objective is to do SQL on a big = hbase table that has a composite key, i decided to start slow and I was abl= e to create a table on phoenix, upsert values and see them on hbase, but I am not able to do the oposite: map (using a view) values o= n an existing hbase to a phoenix table, i am always getting "null"= ; values.

 

Here is a basic example copied from the d= ocs:

 

HBASE:

> create 't1', {NAME =3D> 'f1', VERS= IONS =3D> 5} 

 

PHOENIX:

> CREATE VIEW "t1" ( pk VARCHAR PRIMARY KEY, = "f1".val VARCHAR );
> select * from "t1";
+------------+------------+
|     PK     |    VA= L     |
+------------+------------+
+------------+------------+ 

 

Works fine since there is no data.=

 

I add data to hbase:=

> put 't1,'r1','f1','a'

> scan 't1'

ROW                = ;                     &nb= sp;     COLUMN+CELL

 r1               =                      = ;       column=3Df1:, timestamp=3D1396558806334, value=3Da

 

But if i try to select from phoenix i get= only null values.:

> select * from "t1";

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

|     PK     |    VAL  =   |

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

| r1         | null     &nbs= p; |

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

 

I also tried to save it on an specific co= lumn in the column family:

 

> scan 't1'

ROW                = ;                     &nb= sp;     COLUMN+CELL

 r1               =                      = ;       column=3Df1:, timestamp=3D1396558806334, value=3Da

 r1               =                      = ;       column=3Df1:val, timestamp=3D1396558762590, value=3D= a

 

I also tried to change from varchar to in= teger and insert numbers but i got the same result in both cases.=

 

I am using phoenix 2.2.0 on EMR.

 

Any help you can give me is appreciated.<= u>

 

Thanks,

Daniel







--20cf30434c34c8e6d604f6a1b2ae--