You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Vladimir Sitnikov (JIRA)" <ji...@apache.org> on 2014/11/08 17:18:33 UTC

[jira] [Updated] (CALCITE-458) ArrayIndexOutOfBoundsException when using just a single column in interpreter

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

Vladimir Sitnikov updated CALCITE-458:
--------------------------------------
    Summary: ArrayIndexOutOfBoundsException when using just a single column in interpreter  (was: ArrayIndexOutOfBoundsException when using just a simple column in interpreter)

> ArrayIndexOutOfBoundsException when using just a single column in interpreter
> -----------------------------------------------------------------------------
>
>                 Key: CALCITE-458
>                 URL: https://issues.apache.org/jira/browse/CALCITE-458
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 0.9.1-incubating
>            Reporter: Vladimir Sitnikov
>            Assignee: Julian Hyde
>
> I've tried to alter {{where i=4}} to {{where k=4}} in {{ScannableTableTest.testPFTableRefusesFilter}} and it did fail.
> {code:java}
>   @Test public void testPFTableRefusesFilterSingleColumn() throws Exception {
>     Connection connection =
>         DriverManager.getConnection("jdbc:calcite:");
>     OptiqConnection optiqConnection =
>         connection.unwrap(OptiqConnection.class);
>     SchemaPlus rootSchema = optiqConnection.getRootSchema();
>     SchemaPlus schema = rootSchema.add("s", new AbstractSchema());
>     final StringBuilder buf = new StringBuilder();
>     schema.add("beatles2", new BeatlesProjectableFilterableTable(buf, false));
>     // Now with an "uncooperative" filterable table that refuses to accept
>     // filters.
>     final Statement statement = connection.createStatement();
>     ResultSet resultSet = statement.executeQuery(
>         "select \"k\" from \"s\".\"beatles2\" where \"k\" = 4");
>     // Not sure what the result should be
>   }
> {code}
> {noformat}
> java.sql.SQLException: exception while executing query: 2
> 	at net.hydromatic.avatica.Helper.createException(Helper.java:39)
> 	at net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:406)
> 	at net.hydromatic.avatica.AvaticaStatement.executeQueryInternal(AvaticaStatement.java:350)
> 	at net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:77)
> 	at net.hydromatic.optiq.test.ScannableTableTest.testPFTableRefusesFilter(ScannableTableTest.java:210)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> 	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
> 	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
> 	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
> 	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 2
> 	at net.hydromatic.optiq.impl.interpreter.Interpreter$3.execute(Interpreter.java:187)
> 	at net.hydromatic.optiq.impl.interpreter.Interpreter$2$1.get(Interpreter.java:171)
> 	at net.hydromatic.optiq.impl.interpreter.Interpreter$2.execute(Interpreter.java:124)
> 	at net.hydromatic.optiq.impl.interpreter.FilterNode.run(FilterNode.java:41)
> 	at net.hydromatic.optiq.impl.interpreter.Interpreter.start(Interpreter.java:91)
> 	at net.hydromatic.optiq.impl.interpreter.Interpreter.enumerator(Interpreter.java:58)
> 	at net.hydromatic.linq4j.EnumerableDefaults$6$1.<init>(EnumerableDefaults.java:1382)
> 	at net.hydromatic.linq4j.EnumerableDefaults$6.enumerator(EnumerableDefaults.java:1381)
> 	at net.hydromatic.optiq.jdbc.OptiqPrepare$PrepareResult.enumerator(OptiqPrepare.java:287)
> 	at net.hydromatic.optiq.jdbc.OptiqPrepare$PrepareResult.createCursor(OptiqPrepare.java:251)
> 	at net.hydromatic.optiq.jdbc.MetaImpl.createCursor(MetaImpl.java:616)
> 	at net.hydromatic.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:161)
> 	at net.hydromatic.optiq.jdbc.OptiqResultSet.execute(OptiqResultSet.java:58)
> 	at net.hydromatic.optiq.jdbc.OptiqResultSet.execute(OptiqResultSet.java:35)
> 	at net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:404)
> 	... 29 more{noformat}



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