phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "daniel meng (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (PHOENIX-1709) And expression of primary key RVCs can not compile
Date Mon, 09 Mar 2015 11:50:38 GMT

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

daniel meng edited comment on PHOENIX-1709 at 3/9/15 11:50 AM:
---------------------------------------------------------------

part(2) issue is:
     we have a RVC  (a,b) in ((2,3)) where a, b is primary key; then we get a lower bound
of key range
     (0x80,0x00,0x00,0x02,0x80,0x00,0x00,0x03)
     Use RowKeySchema to iterator on the lower bound
     {code:java}
          schema.iterator(key,ptr); // key is above lower bound
          schema.next(ptr,position,key.length); // position is the primary key pos of "a"
          byte[] output = ByteUtil.copyKeyBytesIfNecessary(ptr);
     {code}
     output should be "0x80,0x00,0x00,0x02"
     but if table is multi-tenant and tenant column is not fixed length, output turn out to
be  "0x00,0x00,0x02,0x80"
     you can see the first "0x80" is skipped
     
     


was (Author: daniel.m):
part(2) issue is:
     we have a RVC  (a,b) in ((2,3)) where a, b is primary key; then we get a lower bound
of key range
     (0x80,0x00,0x00,0x02,0x80,0x00,0x00,0x03)
     Use RowKeySchema to iterator on the lower bound
     {code:java}
          schema.iterator(key,ptr); // above lower bound
          schema.next(ptr,position,key.length); // position is the primary key pos of "a"
          byte[] output = ByteUtil.copyKeyBytesIfNecessary(ptr);
     {code}
     output should be "0x80,0x00,0x00,0x02"
     but if table is multi-tenant and tenant column is not fixed length, output turn out to
be  "0x00,0x00,0x02,0x80"
     you can see the first "0x80" is skipped
     
     

> And expression of primary key RVCs can not compile
> --------------------------------------------------
>
>                 Key: PHOENIX-1709
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1709
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: James Taylor
>         Attachments: PHOENIX-1709.patch, PHOENIX-1709_v2.patch, PHOENIX-1709_v3.patch,
PHOENIX-1709_v4.patch
>
>
>   1 . create table t (a integer not null, b integer not null, c integer
> constraint pk primary key (a,b));
>   2. select c from t where a in (1,2) and b = 3 and (a,b) in ( (1,2) , (1,3));
>   I got exception on compile :
>   java.lang.IllegalArgumentException
>    at
> com.google.common.base.Preconditions.checkArgument(Preconditions.java:76)
>    at
> org.apache.phoenix.compile.WhereOptimizer$KeyExpressionVisitor$KeySlot.inter
> sect(WhereOptimizer.java:955)
>    at
> org.apache.phoenix.compile.WhereOptimizer$KeyExpressionVisitor.intersectSlot
> s(WhereOptimizer.java:506)
>    at
> org.apache.phoenix.compile.WhereOptimizer$KeyExpressionVisitor.andKeySlots(W
> hereOptimizer.java:551)
>    at
> org.apache.phoenix.compile.WhereOptimizer$KeyExpressionVisitor.visitLeave(Wh
> ereOptimizer.java:725)
>    at
> org.apache.phoenix.compile.WhereOptimizer$KeyExpressionVisitor.visitLeave(Wh
> ereOptimizer.java:349)
>    at
> org.apache.phoenix.expression.AndExpression.accept(AndExpression.java:100)
>    at
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOpti
> mizer.java:117)
>    at
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:105)
>    at
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.ja
> va:324)
>    at
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:132)
>    at
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePl
> an(PhoenixStatement.java:296)
>    at
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePl
> an(PhoenixStatement.java:284)
>    at
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:208)
>    at
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:204)
>    at
> org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.j
> ava:54)
>    at
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:
> 204)
>    at
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:967)
>    at sqlline.SqlLine$Commands.execute(SqlLine.java:3673)
>    at sqlline.SqlLine$Commands.sql(SqlLine.java:3584)
>    at sqlline.SqlLine.dispatch(SqlLine.java:821)
>    at sqlline.SqlLine.begin(SqlLine.java:699)
>    at sqlline.SqlLine.mainWithInputRedirection(SqlLine.java:441)
>    at sqlline.SqlLine.main(SqlLine.java:424)



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

Mime
View raw message