forcedotcom / phoenix

BSD 3-Clause "New" or "Revised" License
558 stars 227 forks source link

NPE on Join over Salted table #642

Closed mujtabachohan closed 10 years ago

mujtabachohan commented 10 years ago

Exception java.lang.NullPointerException: at index 3 at com.google.common.collect.ImmutableList.checkElementNotNull(ImmutableList.java:311) at com.google.common.collect.ImmutableList.construct(ImmutableList.java:302) at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:278) at com.salesforce.phoenix.schema.PTableImpl.init(PTableImpl.java:249) at com.salesforce.phoenix.schema.PTableImpl.(PTableImpl.java:193) at com.salesforce.phoenix.schema.PTableImpl.makePTable(PTableImpl.java:186) at com.salesforce.phoenix.compile.JoinCompiler$JoinSpec.createProjectedTable(JoinCompiler.java:268) at com.salesforce.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:161) at com.salesforce.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:142) at com.salesforce.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:120) at com.salesforce.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:46) at com.salesforce.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:41) at com.salesforce.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.optimizePlan(PhoenixStatement.java:219) at com.salesforce.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.executeQuery(PhoenixStatement.java:197) at com.salesforce.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.execute(PhoenixStatement.java:208) at com.salesforce.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:942)

DDL and Query LHS salted table DDL: CREATE TABLE IF NOT EXISTS LHS (mypk CHAR(10) NOT NULL PRIMARY KEY,CF.col1 char(10),CF.col2 char(10),CF.col3 char(10)) SALT_BUCKETS=4

RHS salted table DDL: CREATE TABLE IF NOT EXISTS RHS (mypk CHAR(10) NOT NULL PRIMARY KEY,CF.col1 char(10),CF.col2 char(10),CF.col3 char(10))

Query: select count(*) from LHS JOIN RHS on RHS.mypk = LHS.col1

maryannxue commented 10 years ago

@mujtabachohan Got it fixed in pull request #651

jtaylor-sfdc commented 10 years ago

Fixed in master, but still needs more testing.