phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "soyoon park (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PHOENIX-2364) timestamp type primary key desc error
Date Mon, 02 Nov 2015 08:38:27 GMT

     [ https://issues.apache.org/jira/browse/PHOENIX-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

soyoon park updated PHOENIX-2364:
---------------------------------
    Description: 
I wanted to see that I don't have to use reverse scan(HBase) by using PHOENIX query(constraint
pk primary key DESC).
But it did not work.

**TESTED PHOENIX query :

CREATE TABLE TEST_DESC (
TIME TIMESTAMP NOT NULL,
NAME VARCHAR
CONSTRAINT PK PRIMARY KEY (TIME DESC)
);

** sample data

UPSERT INTO TEST_DESC (TIME,NAME) VALUES (TO_TIMESTAMP(current_date()|| ' ' || current_time())
,'a');
UPSERT INTO TEST_DESC (TIME,NAME) VALUES (TO_TIMESTAMP('2003-12-13 10:13:18',),'b');
UPSERT INTO TEST_DESC (TIME,NAME) VALUES (CAST(current_date() AS TIMESTAMP) ,'c');

SELECT * FROM TEST_DESC;

**and then error like below(sqlline)

0: jdbc:phoenix:data01> select * from LGE_VPN;
java.lang.IllegalArgumentException: offset (9) + length (4) exceed the capacity of the array:
4
        at org.apache.hadoop.hbase.util.Bytes.explainWrongLengthOrOffset(Bytes.java:605)
        at org.apache.hadoop.hbase.util.Bytes.toInt(Bytes.java:775)
        at org.apache.hadoop.hbase.util.Bytes.toInt(Bytes.java:761)
        at org.apache.phoenix.schema.types.PUnsignedInt$UnsignedIntCodec.decodeInt(PUnsignedInt.java:162)
        at org.apache.phoenix.schema.types.PTimestamp.toObject(PTimestamp.java:108)
        at org.apache.phoenix.schema.types.PTimestamp.toObject(PTimestamp.java:32)
        at org.apache.phoenix.schema.types.PDataType.toObject(PDataType.java:984)
        at org.apache.phoenix.compile.ExpressionProjector.getValue(ExpressionProjector.java:75)
        at org.apache.phoenix.jdbc.PhoenixResultSet.getString(PhoenixResultSet.java:601)
        at sqlline.Rows$Row.<init>(Rows.java:183)
        at sqlline.IncrementalRows.hasNext(IncrementalRows.java:63)
        at sqlline.VerticalOutputFormat.print(VerticalOutputFormat.java:28)
        at sqlline.SqlLine.print(SqlLine.java:1653)
        at sqlline.Commands.execute(Commands.java:833)
        at sqlline.Commands.sql(Commands.java:732)
        at sqlline.SqlLine.dispatch(SqlLine.java:808)
        at sqlline.SqlLine.begin(SqlLine.java:681)
        at sqlline.SqlLine.start(SqlLine.java:398)
        at sqlline.SqlLine.main(SqlLine.java:292)


  was:
I wanted to see that I don't have to use reverse scan(HBase) by using PHOENIX query(constraint
pk primary key DESC).
But it did not work.

**TESTED PHOENIX query :

CREATE TABLE TEST_DESC (
TIME TIMESTAMP NOT NULL,
NAME VARCHAR
CONSTRAINT PK PRIMARY KEY (TIME DESC)
);

** sample data

UPSERT INTO TEST_DESC (TIME,NAME) VALUES ('2015-10-30 13:27:59.6' /*not nullable*/,'1');
UPSERT INTO TEST_DESC (TIME,NAME) VALUES (TO_TIMESTAMP(current_date()|| ' ' || current_time())
/*not nullable*/,'a');
UPSERT INTO TEST_DESC (TIME,NAME) VALUES (TO_TIMESTAMP('2003-12-13 10:13:18', 'yyyy-MM-dd
hh:mm:ss') /*not nullable*/,'b');
UPSERT INTO TEST_DESC (TIME,NAME) VALUES (CAST(current_date() AS TIMESTAMP) ,'c');

SELECT * FROM TEST_DESC;

**and then error like below(sqlline)

0: jdbc:phoenix:data01> select * from LGE_VPN;
java.lang.IllegalArgumentException: offset (9) + length (4) exceed the capacity of the array:
4
        at org.apache.hadoop.hbase.util.Bytes.explainWrongLengthOrOffset(Bytes.java:605)
        at org.apache.hadoop.hbase.util.Bytes.toInt(Bytes.java:775)
        at org.apache.hadoop.hbase.util.Bytes.toInt(Bytes.java:761)
        at org.apache.phoenix.schema.types.PUnsignedInt$UnsignedIntCodec.decodeInt(PUnsignedInt.java:162)
        at org.apache.phoenix.schema.types.PTimestamp.toObject(PTimestamp.java:108)
        at org.apache.phoenix.schema.types.PTimestamp.toObject(PTimestamp.java:32)
        at org.apache.phoenix.schema.types.PDataType.toObject(PDataType.java:984)
        at org.apache.phoenix.compile.ExpressionProjector.getValue(ExpressionProjector.java:75)
        at org.apache.phoenix.jdbc.PhoenixResultSet.getString(PhoenixResultSet.java:601)
        at sqlline.Rows$Row.<init>(Rows.java:183)
        at sqlline.IncrementalRows.hasNext(IncrementalRows.java:63)
        at sqlline.VerticalOutputFormat.print(VerticalOutputFormat.java:28)
        at sqlline.SqlLine.print(SqlLine.java:1653)
        at sqlline.Commands.execute(Commands.java:833)
        at sqlline.Commands.sql(Commands.java:732)
        at sqlline.SqlLine.dispatch(SqlLine.java:808)
        at sqlline.SqlLine.begin(SqlLine.java:681)
        at sqlline.SqlLine.start(SqlLine.java:398)
        at sqlline.SqlLine.main(SqlLine.java:292)



> timestamp type primary key desc error
> -------------------------------------
>
>                 Key: PHOENIX-2364
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2364
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.6.0
>            Reporter: soyoon park
>
> I wanted to see that I don't have to use reverse scan(HBase) by using PHOENIX query(constraint
pk primary key DESC).
> But it did not work.
> **TESTED PHOENIX query :
> CREATE TABLE TEST_DESC (
> TIME TIMESTAMP NOT NULL,
> NAME VARCHAR
> CONSTRAINT PK PRIMARY KEY (TIME DESC)
> );
> ** sample data
> UPSERT INTO TEST_DESC (TIME,NAME) VALUES (TO_TIMESTAMP(current_date()|| ' ' || current_time())
,'a');
> UPSERT INTO TEST_DESC (TIME,NAME) VALUES (TO_TIMESTAMP('2003-12-13 10:13:18',),'b');
> UPSERT INTO TEST_DESC (TIME,NAME) VALUES (CAST(current_date() AS TIMESTAMP) ,'c');
> SELECT * FROM TEST_DESC;
> **and then error like below(sqlline)
> 0: jdbc:phoenix:data01> select * from LGE_VPN;
> java.lang.IllegalArgumentException: offset (9) + length (4) exceed the capacity of the
array: 4
>         at org.apache.hadoop.hbase.util.Bytes.explainWrongLengthOrOffset(Bytes.java:605)
>         at org.apache.hadoop.hbase.util.Bytes.toInt(Bytes.java:775)
>         at org.apache.hadoop.hbase.util.Bytes.toInt(Bytes.java:761)
>         at org.apache.phoenix.schema.types.PUnsignedInt$UnsignedIntCodec.decodeInt(PUnsignedInt.java:162)
>         at org.apache.phoenix.schema.types.PTimestamp.toObject(PTimestamp.java:108)
>         at org.apache.phoenix.schema.types.PTimestamp.toObject(PTimestamp.java:32)
>         at org.apache.phoenix.schema.types.PDataType.toObject(PDataType.java:984)
>         at org.apache.phoenix.compile.ExpressionProjector.getValue(ExpressionProjector.java:75)
>         at org.apache.phoenix.jdbc.PhoenixResultSet.getString(PhoenixResultSet.java:601)
>         at sqlline.Rows$Row.<init>(Rows.java:183)
>         at sqlline.IncrementalRows.hasNext(IncrementalRows.java:63)
>         at sqlline.VerticalOutputFormat.print(VerticalOutputFormat.java:28)
>         at sqlline.SqlLine.print(SqlLine.java:1653)
>         at sqlline.Commands.execute(Commands.java:833)
>         at sqlline.Commands.sql(Commands.java:732)
>         at sqlline.SqlLine.dispatch(SqlLine.java:808)
>         at sqlline.SqlLine.begin(SqlLine.java:681)
>         at sqlline.SqlLine.start(SqlLine.java:398)
>         at sqlline.SqlLine.main(SqlLine.java:292)



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

Mime
View raw message