forcedotcom / phoenix

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

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 #729

Open wangxianbin1987 opened 10 years ago

wangxianbin1987 commented 10 years ago

we encounter IndexOutOfBoundsException in SQL parsing process, during we run SQL as follow: select p1.db from PERFORMANCE_50000000 as p1 inner join PERFORMANCE_10000000 as p2 on p1.CORE = p2.CORE where p1.core = 31 and p2.core = 7 limit 1.

here is the stack: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.RangeCheck(ArrayList.java:547) at java.util.ArrayList.get(ArrayList.java:322) at org.apache.phoenix.expression.function.RoundDecimalExpression.(RoundDecimalExpression.java:76) at org.apache.phoenix.parse.CastParseNode.convertToRoundExpressionIfNeeded(CastParseNode.java:86) at org.apache.phoenix.compile.ExpressionCompiler.visitLeave(ExpressionCompiler.java:533) at org.apache.phoenix.compile.ExpressionCompiler.visitLeave(ExpressionCompiler.java:106) at org.apache.phoenix.parse.CastParseNode.accept(CastParseNode.java:66) at org.apache.phoenix.compile.JoinCompiler$JoinTable.compileJoinConditions(JoinCompiler.java:652) at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:185) at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:126) at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:264) at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:253) at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableExplainStatement.compilePlan(PhoenixStatement.java:320) at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableExplainStatement.compilePlan(PhoenixStatement.java:300) at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199) at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:922) 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)