You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Anirudha Khanna <ak...@marinsoftware.com> on 2015/03/31 15:23:23 UTC

Extra Column when creating views

Hi All,

I am creating updatable views on a Phoenix table and inserting data into
the table through the views. When I inspect the table through the HBase
shell, I see an extra column there

*0:_0                                        timestamp=1427807823285,
value=*

Just curious why is this column created.

My queries,
- *CREATE TABLE IF NOT EXISTS BASE_TABLE (id UNSIGNED_LONG NOT NULL, vwId
TINYINT(2), someVal VARCHAR, CONSTRAINT "base_table_pk" PRIMARY KEY(id));*
*- CREATE VIEW CHILD_TABLE_1 (settings VARCHAR, extId VARCHAR) AS SELECT *
FROM BASE_TABLE WHERE vwId = 1;*
*- **CREATE VIEW CHILD_TABLE_2 (settings VARCHAR, extId VARCHAR) AS SELECT
* FROM BASE_TABLE WHERE vwId = 2;*

Help is much appreciated.

Cheers,
Anirudha

Re: Extra Column when creating views

Posted by Anirudha Khanna <ak...@marinsoftware.com>.
Thanks Ravi, that explains it quite well actually.

Anirudha

On Wed, Apr 1, 2015 at 10:38 AM, Ravi Kiran <ma...@gmail.com>
wrote:

> Hi Anirudha,
>
>    The following link
> https://groups.google.com/forum/#!msg/phoenix-hbase-user/UWdBghSfePo/BmCxOUOPHn8J
> can be helpful.
>
> Regards
> Ravi
>
> On Wed, Apr 1, 2015 at 9:55 AM, Anirudha Khanna <akhanna@marinsoftware.com
> > wrote:
>
>> Can you explain that a little more please. I dont think I follow.
>>
>> Anirudha
>>
>> On Wed, Apr 1, 2015 at 12:56 AM, Thomas D'Silva <td...@salesforce.com>
>> wrote:
>>
>>> I think its to support the case when all columns of the table are part
>>> of primary key (and are used to construct the rowkey).
>>>
>>> On Tue, Mar 31, 2015 at 6:23 AM, Anirudha Khanna
>>> <ak...@marinsoftware.com> wrote:
>>> > Hi All,
>>> >
>>> > I am creating updatable views on a Phoenix table and inserting data
>>> into the
>>> > table through the views. When I inspect the table through the HBase
>>> shell, I
>>> > see an extra column there
>>> >
>>> > 0:_0                                        timestamp=1427807823285,
>>> value=
>>> >
>>> > Just curious why is this column created.
>>> >
>>> > My queries,
>>> > - CREATE TABLE IF NOT EXISTS BASE_TABLE (id UNSIGNED_LONG NOT NULL,
>>> vwId
>>> > TINYINT(2), someVal VARCHAR, CONSTRAINT "base_table_pk" PRIMARY
>>> KEY(id));
>>> > - CREATE VIEW CHILD_TABLE_1 (settings VARCHAR, extId VARCHAR) AS
>>> SELECT *
>>> > FROM BASE_TABLE WHERE vwId = 1;
>>> > - CREATE VIEW CHILD_TABLE_2 (settings VARCHAR, extId VARCHAR) AS
>>> SELECT *
>>> > FROM BASE_TABLE WHERE vwId = 2;
>>> >
>>> > Help is much appreciated.
>>> >
>>> > Cheers,
>>> > Anirudha
>>>
>>
>>
>

Re: Extra Column when creating views

Posted by Ravi Kiran <ma...@gmail.com>.
Hi Anirudha,

   The following link
https://groups.google.com/forum/#!msg/phoenix-hbase-user/UWdBghSfePo/BmCxOUOPHn8J
can be helpful.

Regards
Ravi

On Wed, Apr 1, 2015 at 9:55 AM, Anirudha Khanna <ak...@marinsoftware.com>
wrote:

> Can you explain that a little more please. I dont think I follow.
>
> Anirudha
>
> On Wed, Apr 1, 2015 at 12:56 AM, Thomas D'Silva <td...@salesforce.com>
> wrote:
>
>> I think its to support the case when all columns of the table are part
>> of primary key (and are used to construct the rowkey).
>>
>> On Tue, Mar 31, 2015 at 6:23 AM, Anirudha Khanna
>> <ak...@marinsoftware.com> wrote:
>> > Hi All,
>> >
>> > I am creating updatable views on a Phoenix table and inserting data
>> into the
>> > table through the views. When I inspect the table through the HBase
>> shell, I
>> > see an extra column there
>> >
>> > 0:_0                                        timestamp=1427807823285,
>> value=
>> >
>> > Just curious why is this column created.
>> >
>> > My queries,
>> > - CREATE TABLE IF NOT EXISTS BASE_TABLE (id UNSIGNED_LONG NOT NULL, vwId
>> > TINYINT(2), someVal VARCHAR, CONSTRAINT "base_table_pk" PRIMARY
>> KEY(id));
>> > - CREATE VIEW CHILD_TABLE_1 (settings VARCHAR, extId VARCHAR) AS SELECT
>> *
>> > FROM BASE_TABLE WHERE vwId = 1;
>> > - CREATE VIEW CHILD_TABLE_2 (settings VARCHAR, extId VARCHAR) AS SELECT
>> *
>> > FROM BASE_TABLE WHERE vwId = 2;
>> >
>> > Help is much appreciated.
>> >
>> > Cheers,
>> > Anirudha
>>
>
>

Re: Extra Column when creating views

Posted by Anirudha Khanna <ak...@marinsoftware.com>.
Can you explain that a little more please. I dont think I follow.

Anirudha

On Wed, Apr 1, 2015 at 12:56 AM, Thomas D'Silva <td...@salesforce.com>
wrote:

> I think its to support the case when all columns of the table are part
> of primary key (and are used to construct the rowkey).
>
> On Tue, Mar 31, 2015 at 6:23 AM, Anirudha Khanna
> <ak...@marinsoftware.com> wrote:
> > Hi All,
> >
> > I am creating updatable views on a Phoenix table and inserting data into
> the
> > table through the views. When I inspect the table through the HBase
> shell, I
> > see an extra column there
> >
> > 0:_0                                        timestamp=1427807823285,
> value=
> >
> > Just curious why is this column created.
> >
> > My queries,
> > - CREATE TABLE IF NOT EXISTS BASE_TABLE (id UNSIGNED_LONG NOT NULL, vwId
> > TINYINT(2), someVal VARCHAR, CONSTRAINT "base_table_pk" PRIMARY KEY(id));
> > - CREATE VIEW CHILD_TABLE_1 (settings VARCHAR, extId VARCHAR) AS SELECT *
> > FROM BASE_TABLE WHERE vwId = 1;
> > - CREATE VIEW CHILD_TABLE_2 (settings VARCHAR, extId VARCHAR) AS SELECT *
> > FROM BASE_TABLE WHERE vwId = 2;
> >
> > Help is much appreciated.
> >
> > Cheers,
> > Anirudha
>

Re: Extra Column when creating views

Posted by Thomas D'Silva <td...@salesforce.com>.
I think its to support the case when all columns of the table are part
of primary key (and are used to construct the rowkey).

On Tue, Mar 31, 2015 at 6:23 AM, Anirudha Khanna
<ak...@marinsoftware.com> wrote:
> Hi All,
>
> I am creating updatable views on a Phoenix table and inserting data into the
> table through the views. When I inspect the table through the HBase shell, I
> see an extra column there
>
> 0:_0                                        timestamp=1427807823285, value=
>
> Just curious why is this column created.
>
> My queries,
> - CREATE TABLE IF NOT EXISTS BASE_TABLE (id UNSIGNED_LONG NOT NULL, vwId
> TINYINT(2), someVal VARCHAR, CONSTRAINT "base_table_pk" PRIMARY KEY(id));
> - CREATE VIEW CHILD_TABLE_1 (settings VARCHAR, extId VARCHAR) AS SELECT *
> FROM BASE_TABLE WHERE vwId = 1;
> - CREATE VIEW CHILD_TABLE_2 (settings VARCHAR, extId VARCHAR) AS SELECT *
> FROM BASE_TABLE WHERE vwId = 2;
>
> Help is much appreciated.
>
> Cheers,
> Anirudha