[jira] [Commented] (PHOENIX-1077) Exception thrown when executing an IN list of Row Value Constructors against salted tables.

2014-07-11 Thread Samarth Jain (JIRA)

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

Samarth Jain commented on PHOENIX-1077:
---

Looks great [~kbuzsaki]. Fantastic job!

> Exception thrown when executing an IN list of Row Value Constructors against 
> salted tables.
> ---
>
> Key: PHOENIX-1077
> URL: https://issues.apache.org/jira/browse/PHOENIX-1077
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 3.0.0, 4.0.0, 5.0.0
>Reporter: Samarth Jain
>Assignee: Kyle Buzsaki
> Attachments: PHOENIX-1077.patch
>
>
> {code}
> 1) Table - Salted. Query - IN list of RVCs. Result - fails with exception. 
> Details:
> Table DDL - CREATE TABLE t (pk1 varchar(5) NOT NULL, pk2 varchar(5) NOT NULL, 
> pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key (pk1,pk2,pk3)) 
> SALT_BUCKETS=4
> Query - select pk1, pk2, pk3 from t WHERE (pk1, pk2, pk3) IN ((?, ?, ?), (?, 
> ?, ?))
> Exception:
> java.lang.ArrayIndexOutOfBoundsException: 1
>   at org.apache.phoenix.schema.ValueSchema.getField(ValueSchema.java:300)
>   at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:260)
>   at 
> org.apache.phoenix.compile.ScanRanges.getPointKeys(ScanRanges.java:185)
>   at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.java:61)
>   at 
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:224)
>   at 
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:105)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:260)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:128)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:264)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
>   at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:157)
>   at 
> org.apache.phoenix.end2end.RowValueConstructorIT.testInListOfRVC5(RowValueConstructorIT.java:1078)
> 2) Most likely related to 1)  Table - multi-tenant and salted. Query - IN 
> list of RVCs. Result - Fails with exception.  
> Details:
> Base Table DDL - CREATE TABLE t (tenantId varchar(5) NOT NULL, pk2 varchar(5) 
> NOT NULL, pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key 
> (tenantId,pk2,pk3)) SALT_BUCKETS=4, MULTI_TENANT=true
> Tenant View DDL - CREATE VIEW t_view (tenant_col VARCHAR) AS SELECT * FROM t
> Query using global connection : select pk2, pk3 from t WHERE (tenantId, pk2, 
> pk3) IN ((?, ?, ?), (?, ?, ?))
> Stacktrace:
> java.lang.ArrayIndexOutOfBoundsException: 1
>   at org.apache.phoenix.schema.ValueSchema.getField(ValueSchema.java:300)
>   at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:260)
>   at 
> org.apache.phoenix.compile.ScanRanges.getPointKeys(ScanRanges.java:185)
>   at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.java:61)
>   at 
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:224)
>   at 
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:105)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:260)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:128)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:264)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
>   at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:157)
>   at 
> org.apache.phoenix.end2end.RowValueConstructorIT.testInListOfRVC4(RowValueConstructorIT.java:1042)
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (PHOENIX-1077) Exception thrown when executing an IN list of Row Value Constructors against salted tables.

2014-07-11 Thread Eli Levine (JIRA)

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

Eli Levine commented on PHOENIX-1077:
-

Thanks for the contribution, [~kbuzsaki]. The changes look good but 
[~samarthjain]'s original test case for this Jira still fails. Samarth, is it 
supposed to pass with these changes?  Kyle, can you try your fixes with this 
new test case in TenantSpecificTablesDMLIT.java:
{code}
@Test
public void testRVCOnTenantSpecificTable() throws Exception {
Connection conn = nextConnection(PHOENIX_JDBC_TENANT_SPECIFIC_URL);
try {
conn.setAutoCommit(true);
conn.createStatement().executeUpdate("upsert into " + 
TENANT_TABLE_NAME + " (id, user) values (1, 'BonA')");
conn.createStatement().executeUpdate("upsert into " + 
TENANT_TABLE_NAME + " (id, user) values (2, 'BonB')");
conn.createStatement().executeUpdate("upsert into " + 
TENANT_TABLE_NAME + " (id, user) values (3, 'BonC')");

conn.close();

conn = nextConnection(PHOENIX_JDBC_TENANT_SPECIFIC_URL);
PreparedStatement stmt = conn.prepareStatement("select id from " + 
TENANT_TABLE_NAME + " WHERE (id, user) IN ((?, ?), (?, ?), (?, ?))");
stmt.setInt(1, 1);
stmt.setString(2, "BonA");
stmt.setInt(3, 2);
stmt.setString(4, "BonB");
stmt.setInt(5, 3);
stmt.setString(6, "BonC");
ResultSet rs = stmt.executeQuery();
assertTrue(rs.next());
assertEquals(1, rs.getInt(1));
assertTrue(rs.next());
assertEquals(2, rs.getInt(1));
assertTrue(rs.next());
assertEquals(3, rs.getInt(1));
assertFalse(rs.next());
}
{code}

> Exception thrown when executing an IN list of Row Value Constructors against 
> salted tables.
> ---
>
> Key: PHOENIX-1077
> URL: https://issues.apache.org/jira/browse/PHOENIX-1077
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 3.0.0, 4.0.0, 5.0.0
>Reporter: Samarth Jain
>Assignee: Kyle Buzsaki
> Attachments: PHOENIX-1077.patch
>
>
> {code}
> 1) Table - Salted. Query - IN list of RVCs. Result - fails with exception. 
> Details:
> Table DDL - CREATE TABLE t (pk1 varchar(5) NOT NULL, pk2 varchar(5) NOT NULL, 
> pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key (pk1,pk2,pk3)) 
> SALT_BUCKETS=4
> Query - select pk1, pk2, pk3 from t WHERE (pk1, pk2, pk3) IN ((?, ?, ?), (?, 
> ?, ?))
> Exception:
> java.lang.ArrayIndexOutOfBoundsException: 1
>   at org.apache.phoenix.schema.ValueSchema.getField(ValueSchema.java:300)
>   at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:260)
>   at 
> org.apache.phoenix.compile.ScanRanges.getPointKeys(ScanRanges.java:185)
>   at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.java:61)
>   at 
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:224)
>   at 
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:105)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:260)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:128)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:264)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
>   at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:157)
>   at 
> org.apache.phoenix.end2end.RowValueConstructorIT.testInListOfRVC5(RowValueConstructorIT.java:1078)
> 2) Most likely related to 1)  Table - multi-tenant and salted. Query - IN 
> list of RVCs. Result - Fails with exception.  
> Details:
> Base Table DDL - CREATE TABLE t (tenantId varchar(5) NOT NULL, pk2 varchar(5) 
> NOT NULL, pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key 
> (tenantId,pk2,pk3)) SALT_BUCKETS=4, MULTI_TENANT=true
> Tenant View DDL - CREATE VIEW t_view (tenant_col VARCHAR) AS SELECT * FROM t
> Query using global connection : select pk2, pk3 from t WHERE (tenantId, pk2, 
> pk3) IN ((?, ?, ?), (?, ?, ?))
> Stacktrace:
> java.lang.ArrayIndexOutOfBoundsException: 1
>   at org.apache.phoenix.schema.ValueSchema.getField(ValueSchema.java:300)
>   at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:260)
>   at 
> org.apache.phoenix.compile.ScanRanges.getPointKeys(ScanRanges.java:185)
>   at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.j

[jira] [Commented] (PHOENIX-1077) Exception thrown when executing an IN list of Row Value Constructors against salted tables.

2014-07-11 Thread Kyle Buzsaki (JIRA)

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

Kyle Buzsaki commented on PHOENIX-1077:
---

How does that testcase fail? The patch I provided fixes the 
ArrayIndexOutOfBoundsException error. It does not fix the issue of some rows 
not being returned, which appears to be a different bug. Samarth filed separate 
JIRAs at PHOENIX-1082 and PHOENIX-1083 for the testcases that were still 
failing after this change.

> Exception thrown when executing an IN list of Row Value Constructors against 
> salted tables.
> ---
>
> Key: PHOENIX-1077
> URL: https://issues.apache.org/jira/browse/PHOENIX-1077
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 3.0.0, 4.0.0, 5.0.0
>Reporter: Samarth Jain
>Assignee: Kyle Buzsaki
> Attachments: PHOENIX-1077.patch
>
>
> {code}
> 1) Table - Salted. Query - IN list of RVCs. Result - fails with exception. 
> Details:
> Table DDL - CREATE TABLE t (pk1 varchar(5) NOT NULL, pk2 varchar(5) NOT NULL, 
> pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key (pk1,pk2,pk3)) 
> SALT_BUCKETS=4
> Query - select pk1, pk2, pk3 from t WHERE (pk1, pk2, pk3) IN ((?, ?, ?), (?, 
> ?, ?))
> Exception:
> java.lang.ArrayIndexOutOfBoundsException: 1
>   at org.apache.phoenix.schema.ValueSchema.getField(ValueSchema.java:300)
>   at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:260)
>   at 
> org.apache.phoenix.compile.ScanRanges.getPointKeys(ScanRanges.java:185)
>   at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.java:61)
>   at 
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:224)
>   at 
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:105)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:260)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:128)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:264)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
>   at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:157)
>   at 
> org.apache.phoenix.end2end.RowValueConstructorIT.testInListOfRVC5(RowValueConstructorIT.java:1078)
> 2) Most likely related to 1)  Table - multi-tenant and salted. Query - IN 
> list of RVCs. Result - Fails with exception.  
> Details:
> Base Table DDL - CREATE TABLE t (tenantId varchar(5) NOT NULL, pk2 varchar(5) 
> NOT NULL, pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key 
> (tenantId,pk2,pk3)) SALT_BUCKETS=4, MULTI_TENANT=true
> Tenant View DDL - CREATE VIEW t_view (tenant_col VARCHAR) AS SELECT * FROM t
> Query using global connection : select pk2, pk3 from t WHERE (tenantId, pk2, 
> pk3) IN ((?, ?, ?), (?, ?, ?))
> Stacktrace:
> java.lang.ArrayIndexOutOfBoundsException: 1
>   at org.apache.phoenix.schema.ValueSchema.getField(ValueSchema.java:300)
>   at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:260)
>   at 
> org.apache.phoenix.compile.ScanRanges.getPointKeys(ScanRanges.java:185)
>   at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.java:61)
>   at 
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:224)
>   at 
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:105)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:260)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:128)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:264)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
>   at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:157)
>   at 
> org.apache.phoenix.end2end.RowValueConstructorIT.testInListOfRVC4(RowValueConstructorIT.java:1042)
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (PHOENIX-1077) Exception thrown when executing an IN list of Row Value Constructors against salted tables.

2014-07-11 Thread Eli Levine (JIRA)

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

Eli Levine commented on PHOENIX-1077:
-

Yep, Samarth's test case fails with expected rows not being returned. 
Committing your fix. Thanks!

> Exception thrown when executing an IN list of Row Value Constructors against 
> salted tables.
> ---
>
> Key: PHOENIX-1077
> URL: https://issues.apache.org/jira/browse/PHOENIX-1077
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 3.0.0, 4.0.0, 5.0.0
>Reporter: Samarth Jain
>Assignee: Kyle Buzsaki
> Attachments: PHOENIX-1077.patch
>
>
> {code}
> 1) Table - Salted. Query - IN list of RVCs. Result - fails with exception. 
> Details:
> Table DDL - CREATE TABLE t (pk1 varchar(5) NOT NULL, pk2 varchar(5) NOT NULL, 
> pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key (pk1,pk2,pk3)) 
> SALT_BUCKETS=4
> Query - select pk1, pk2, pk3 from t WHERE (pk1, pk2, pk3) IN ((?, ?, ?), (?, 
> ?, ?))
> Exception:
> java.lang.ArrayIndexOutOfBoundsException: 1
>   at org.apache.phoenix.schema.ValueSchema.getField(ValueSchema.java:300)
>   at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:260)
>   at 
> org.apache.phoenix.compile.ScanRanges.getPointKeys(ScanRanges.java:185)
>   at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.java:61)
>   at 
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:224)
>   at 
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:105)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:260)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:128)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:264)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
>   at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:157)
>   at 
> org.apache.phoenix.end2end.RowValueConstructorIT.testInListOfRVC5(RowValueConstructorIT.java:1078)
> 2) Most likely related to 1)  Table - multi-tenant and salted. Query - IN 
> list of RVCs. Result - Fails with exception.  
> Details:
> Base Table DDL - CREATE TABLE t (tenantId varchar(5) NOT NULL, pk2 varchar(5) 
> NOT NULL, pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key 
> (tenantId,pk2,pk3)) SALT_BUCKETS=4, MULTI_TENANT=true
> Tenant View DDL - CREATE VIEW t_view (tenant_col VARCHAR) AS SELECT * FROM t
> Query using global connection : select pk2, pk3 from t WHERE (tenantId, pk2, 
> pk3) IN ((?, ?, ?), (?, ?, ?))
> Stacktrace:
> java.lang.ArrayIndexOutOfBoundsException: 1
>   at org.apache.phoenix.schema.ValueSchema.getField(ValueSchema.java:300)
>   at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:260)
>   at 
> org.apache.phoenix.compile.ScanRanges.getPointKeys(ScanRanges.java:185)
>   at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.java:61)
>   at 
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:224)
>   at 
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:105)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:260)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:128)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:264)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
>   at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:157)
>   at 
> org.apache.phoenix.end2end.RowValueConstructorIT.testInListOfRVC4(RowValueConstructorIT.java:1042)
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (PHOENIX-1077) Exception thrown when executing an IN list of Row Value Constructors against salted tables.

2014-07-11 Thread Hudson (JIRA)

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

Hudson commented on PHOENIX-1077:
-

SUCCESS: Integrated in Phoenix | Master | Hadoop1 #269 (See 
[https://builds.apache.org/job/Phoenix-master-hadoop1/269/])
Fix for PHOENIX-1077 in main branch (fixed by Kyle Buzsaki) (elilevine: rev 
7b313526018646ec10c0d7f714869a9c69d34f8f)
* phoenix-core/src/main/java/org/apache/phoenix/schema/ValueSchema.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/SaltingUtil.java
* phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java


> Exception thrown when executing an IN list of Row Value Constructors against 
> salted tables.
> ---
>
> Key: PHOENIX-1077
> URL: https://issues.apache.org/jira/browse/PHOENIX-1077
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 3.0.0, 4.0.0, 5.0.0
>Reporter: Samarth Jain
>Assignee: Kyle Buzsaki
> Attachments: PHOENIX-1077.patch
>
>
> {code}
> 1) Table - Salted. Query - IN list of RVCs. Result - fails with exception. 
> Details:
> Table DDL - CREATE TABLE t (pk1 varchar(5) NOT NULL, pk2 varchar(5) NOT NULL, 
> pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key (pk1,pk2,pk3)) 
> SALT_BUCKETS=4
> Query - select pk1, pk2, pk3 from t WHERE (pk1, pk2, pk3) IN ((?, ?, ?), (?, 
> ?, ?))
> Exception:
> java.lang.ArrayIndexOutOfBoundsException: 1
>   at org.apache.phoenix.schema.ValueSchema.getField(ValueSchema.java:300)
>   at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:260)
>   at 
> org.apache.phoenix.compile.ScanRanges.getPointKeys(ScanRanges.java:185)
>   at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.java:61)
>   at 
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:224)
>   at 
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:105)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:260)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:128)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:264)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
>   at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:157)
>   at 
> org.apache.phoenix.end2end.RowValueConstructorIT.testInListOfRVC5(RowValueConstructorIT.java:1078)
> 2) Most likely related to 1)  Table - multi-tenant and salted. Query - IN 
> list of RVCs. Result - Fails with exception.  
> Details:
> Base Table DDL - CREATE TABLE t (tenantId varchar(5) NOT NULL, pk2 varchar(5) 
> NOT NULL, pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key 
> (tenantId,pk2,pk3)) SALT_BUCKETS=4, MULTI_TENANT=true
> Tenant View DDL - CREATE VIEW t_view (tenant_col VARCHAR) AS SELECT * FROM t
> Query using global connection : select pk2, pk3 from t WHERE (tenantId, pk2, 
> pk3) IN ((?, ?, ?), (?, ?, ?))
> Stacktrace:
> java.lang.ArrayIndexOutOfBoundsException: 1
>   at org.apache.phoenix.schema.ValueSchema.getField(ValueSchema.java:300)
>   at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:260)
>   at 
> org.apache.phoenix.compile.ScanRanges.getPointKeys(ScanRanges.java:185)
>   at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.java:61)
>   at 
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:224)
>   at 
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:105)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:260)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:128)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:264)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
>   at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:157)
>   at 
> org.apache.phoenix.end2end.RowValueConstructorIT.testInListOfRVC4(RowValueConstructorIT.java:1042)
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (PHOENIX-1077) Exception thrown when executing an IN list of Row Value Constructors against salted tables.

2014-07-11 Thread Hudson (JIRA)

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

Hudson commented on PHOENIX-1077:
-

SUCCESS: Integrated in Phoenix | 3.0 | Hadoop1 #133 (See 
[https://builds.apache.org/job/Phoenix-3.0-hadoop1/133/])
Fix for PHOENIX-1077 in 3.0 branch (fixed by Kyle Buzsaki) (elilevine: rev 
fd4a1a5d05861d8e5e7c153cecc480e9ff8b0229)
* phoenix-core/src/main/java/org/apache/phoenix/schema/ValueSchema.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/SaltingUtil.java
* phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java


> Exception thrown when executing an IN list of Row Value Constructors against 
> salted tables.
> ---
>
> Key: PHOENIX-1077
> URL: https://issues.apache.org/jira/browse/PHOENIX-1077
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 3.0.0, 4.0.0, 5.0.0
>Reporter: Samarth Jain
>Assignee: Kyle Buzsaki
> Attachments: PHOENIX-1077.patch
>
>
> {code}
> 1) Table - Salted. Query - IN list of RVCs. Result - fails with exception. 
> Details:
> Table DDL - CREATE TABLE t (pk1 varchar(5) NOT NULL, pk2 varchar(5) NOT NULL, 
> pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key (pk1,pk2,pk3)) 
> SALT_BUCKETS=4
> Query - select pk1, pk2, pk3 from t WHERE (pk1, pk2, pk3) IN ((?, ?, ?), (?, 
> ?, ?))
> Exception:
> java.lang.ArrayIndexOutOfBoundsException: 1
>   at org.apache.phoenix.schema.ValueSchema.getField(ValueSchema.java:300)
>   at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:260)
>   at 
> org.apache.phoenix.compile.ScanRanges.getPointKeys(ScanRanges.java:185)
>   at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.java:61)
>   at 
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:224)
>   at 
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:105)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:260)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:128)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:264)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
>   at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:157)
>   at 
> org.apache.phoenix.end2end.RowValueConstructorIT.testInListOfRVC5(RowValueConstructorIT.java:1078)
> 2) Most likely related to 1)  Table - multi-tenant and salted. Query - IN 
> list of RVCs. Result - Fails with exception.  
> Details:
> Base Table DDL - CREATE TABLE t (tenantId varchar(5) NOT NULL, pk2 varchar(5) 
> NOT NULL, pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key 
> (tenantId,pk2,pk3)) SALT_BUCKETS=4, MULTI_TENANT=true
> Tenant View DDL - CREATE VIEW t_view (tenant_col VARCHAR) AS SELECT * FROM t
> Query using global connection : select pk2, pk3 from t WHERE (tenantId, pk2, 
> pk3) IN ((?, ?, ?), (?, ?, ?))
> Stacktrace:
> java.lang.ArrayIndexOutOfBoundsException: 1
>   at org.apache.phoenix.schema.ValueSchema.getField(ValueSchema.java:300)
>   at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:260)
>   at 
> org.apache.phoenix.compile.ScanRanges.getPointKeys(ScanRanges.java:185)
>   at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.java:61)
>   at 
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:224)
>   at 
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:105)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:260)
>   at 
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:128)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:264)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
>   at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:157)
>   at 
> org.apache.phoenix.end2end.RowValueConstructorIT.testInListOfRVC4(RowValueConstructorIT.java:1042)
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)