You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2015/07/31 01:43:04 UTC

[jira] [Commented] (PHOENIX-2159) Grammar changes and DDL support for surfacing native HBase timestamp

    [ https://issues.apache.org/jira/browse/PHOENIX-2159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14648505#comment-14648505 ] 

James Taylor commented on PHOENIX-2159:
---------------------------------------

Can we have ROW_TIMESTAMP a kind of optional sibling with the ASC/DESC modifier so that it's part of the primary key constraint definition? For example, the following would be allowed:
{code}
CREATE TABLE T (
    K1 DATE PRIMARY KEY ROW_TIMESTAMP);

CREATE TABLE T (
    K1 TIME PRIMARY KEY ROW_TIMESTAMP,
    V1 VARCHAR);

CREATE TABLE T (
    K1 VARCHAR,
    K2 BIGINT,
    CONSTRAINT PK PRIMARY KEY(K1, K2 ROW_TIMESTAMP));
{code}

We could allow DATE, and BIGIINT as the type for a column marked as the ROW_TIMESTAMP.

The following wouldn't be valid:
{code}
CREATE TABLE T (
    K1 DATE ROW_TIMESTAMP, -- may only be defined as part of PK definition
    K2 VARCHAR); 

CREATE TABLE T (
    K1 DATE PRIMARY KEY ROW_TIMESTAMP, -- invalid as essentially defining PK multiple times
    K2 VARCHAR,
    CONSTRAINT pk PRIMARY KEY (K1, K2)); 

CREATE TABLE T (
    K1 DATE ROW_TIMESTAMP, -- must appear in CONSTRAINT definition below just like DESC declaration
    K2 VARCHAR,
    CONSTRAINT pk PRIMARY KEY (K1, K2)); 

CREATE TABLE T (
    K1 VARCHAR,
    K2 VARCHAR,
    CONSTRAINT PK PRIMARY KEY(K1, K2 ROW_TIMESTAMP)); -- invalid type for ROW_TIMESTAMP
{code}


> Grammar changes and DDL support for surfacing native HBase timestamp
> --------------------------------------------------------------------
>
>                 Key: PHOENIX-2159
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2159
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Samarth Jain
>            Assignee: Samarth Jain
>         Attachments: PHOENIX-2159.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)