phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Taylor <jamestay...@apache.org>
Subject Re: PHX 4; mutable index strangeness
Date Thu, 13 Mar 2014 22:13:00 GMT
Hi Stan,
Not positive it's related, but I just checked in a fix for
https://issues.apache.org/jira/browse/PHOENIX-127.

This worked for my on my local build (with this fix). Is this different
than what you're doing? Also, FWIW, if a table is salted, the index is by
default salted in the same way.

Thanks,
James

0: jdbc:phoenix:localhost> CREATE TABLE SITE_ACTIVITY_UPDATES (

. . . . . . . . . . . . .>

. . . . . . . . . . . . .>   SITE_ID VARCHAR(255),

. . . . . . . . . . . . .>   UPDATED_AT  DATE

. . . . . . . . . . . . .>

. . . . . . . . . . . . .>     CONSTRAINT PK PRIMARY KEY (SITE_ID)

. . . . . . . . . . . . .> ) SALT_BUCKETS = 3;

No rows affected (6.308 seconds)

0: jdbc:phoenix:localhost>

0: jdbc:phoenix:localhost> UPSERT INTO SITE_ACTIVITY_UPDATES(SITE_ID,
UPDATED_AT) VALUES ('ABC123',NULL);

1 row affected (0.015 seconds)

0: jdbc:phoenix:localhost> select * from site_activity_updates;

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

|  SITE_ID   |     UPDATED_AT      |

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

| ABC123     | null                |

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

1 row selected (0.048 seconds)

0: jdbc:phoenix:localhost> CREATE INDEX SITE_ACTIVITY_UPDATES_BY_CREATED_AT
ON SITE_ACTIVITY_UPDATES (UPDATED_AT) SALT_BUCKETS = 3;

1 row affected (6.253 seconds)

0: jdbc:phoenix:localhost>

0: jdbc:phoenix:localhost> select * from site_activity_updates;

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

|  SITE_ID   |     UPDATED_AT      |

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

| ABC123     | null                |

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

1 row selected (0.076 seconds)


On Thu, Mar 13, 2014 at 1:27 PM, Stan Campbell <stan.campbell3@gmail.com>wrote:

> This is odd.. I think?
>
> If I create a simple table like..
>
> CREATE TABLE SITE_ACTIVITY_UPDATES (
>
>   SITE_ID VARCHAR(255),
>   UPDATED_AT  DATE
>
>     CONSTRAINT PK PRIMARY KEY (SITE_ID)
> ) SALT_BUCKETS = 3;
>
> If I do a test insert of...
>
> UPSERT INTO SITE_ACTIVITY_UPDATES(SITE_ID, UPDATED_AT) VALUES
> ('ABC123',NULL);
>
> Then the following select returns the row as expected.
>
> However, if I add an index like this..
>
> CREATE INDEX SITE_ACTIVITY_UPDATES_BY_CREATED_AT ON SITE_ACTIVITY_UPDATES
> (UPDATED_AT) SALT_BUCKETS = 3;
>
> Then the row is apparently not inserted at all?
>
> Am I doing something incredibly silly?
>
> -- Stan
>

Mime
View raw message