Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-196

Enabling FINER logging causes exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      When enabling FINER logging, an exception occurs that does not occure when logging at a higher level.

      For example, JdbcTest.testJdbcDate fails with:

      ```
      java.lang.RuntimeException: exception while executing [select count as c from (
      select 1 from "foodmart"."employee" as e1
      where "position_title" = 'VP Country Manager'
      and "birth_date" < DATE '1950-01-01'
      and "gender" = 'F')]
      at net.hydromatic.optiq.test.OptiqAssert$AssertQuery.returns(OptiqAssert.java:785)
      at net.hydromatic.optiq.test.OptiqAssert$AssertQuery.returns(OptiqAssert.java:772)
      at net.hydromatic.optiq.test.JdbcTest.testJdbcDate(JdbcTest.java:964)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      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:202)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
      Caused by: java.lang.RuntimeException: With materializationsEnabled=false, limit=0
      at net.hydromatic.optiq.test.OptiqAssert.assertQuery(OptiqAssert.java:345)
      at net.hydromatic.optiq.test.OptiqAssert$AssertQuery.returns(OptiqAssert.java:781)
      ... 28 more
      Caused by: java.sql.SQLException: while executing SQL: select count as c from (
      select 1 from "foodmart"."employee" as e1
      where "position_title" = 'VP Country Manager'
      and "birth_date" < DATE '1950-01-01'
      and "gender" = 'F')
      at net.hydromatic.avatica.Helper.createException(Helper.java:40)
      at net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:80)
      at net.hydromatic.optiq.test.OptiqAssert.assertQuery(OptiqAssert.java:320)
      ... 29 more
      Caused by: java.lang.reflect.UndeclaredThrowableException
      at com.sun.proxy.$Proxy11.getCumulativeCost(Unknown Source)
      at org.eigenbase.rel.metadata.RelMetadataQuery.getCumulativeCost(RelMetadataQuery.java:109)
      at org.eigenbase.relopt.AbstractRelOptPlanner.getCost(AbstractRelOptPlanner.java:197)
      at org.eigenbase.relopt.hep.HepPlanner.dumpGraph(HepPlanner.java:938)
      at org.eigenbase.relopt.hep.HepPlanner.setRoot(HepPlanner.java:116)
      at net.hydromatic.optiq.prepare.Prepare.optimize(Prepare.java:149)
      at net.hydromatic.optiq.prepare.Prepare.prepareSql(Prepare.java:263)
      at net.hydromatic.optiq.prepare.Prepare.prepareSql(Prepare.java:178)
      at net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:333)
      at net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare_(OptiqPrepareImpl.java:242)
      at net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepareSql(OptiqPrepareImpl.java:211)
      at net.hydromatic.optiq.jdbc.OptiqConnectionImpl.parseQuery(OptiqConnectionImpl.java:146)
      at net.hydromatic.optiq.jdbc.MetaImpl.prepare(MetaImpl.java:603)
      at net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:77)
      ... 30 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.eigenbase.rel.metadata.ReflectiveRelMetadataProvider$2$1.invoke(ReflectiveRelMetadataProvider.java:135)
      ... 44 more
      Caused by: java.lang.reflect.UndeclaredThrowableException
      at com.sun.proxy.$Proxy11.getCumulativeCost(Unknown Source)
      at org.eigenbase.rel.metadata.RelMetadataQuery.getCumulativeCost(RelMetadataQuery.java:109)
      at org.eigenbase.rel.metadata.RelMdPercentageOriginalRows.getCumulativeCost(RelMdPercentageOriginalRows.java:152)
      ... 48 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.eigenbase.rel.metadata.ReflectiveRelMetadataProvider$2$1.invoke(ReflectiveRelMetadataProvider.java:135)
      ... 51 more
      Caused by: java.lang.reflect.UndeclaredThrowableException
      at com.sun.proxy.$Proxy7.getNonCumulativeCost(Unknown Source)
      at org.eigenbase.rel.metadata.RelMetadataQuery.getNonCumulativeCost(RelMetadataQuery.java:123)
      at org.eigenbase.rel.metadata.RelMdPercentageOriginalRows.getCumulativeCost(RelMdPercentageOriginalRows.java:149)
      ... 55 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.eigenbase.rel.metadata.ReflectiveRelMetadataProvider$2$1.invoke(ReflectiveRelMetadataProvider.java:135)
      ... 58 more
      Caused by: java.lang.AssertionError: Internal error: should never get here
      at org.eigenbase.util.Util.newInternal(Util.java:755)
      at org.eigenbase.relopt.hep.HepRelVertex.computeSelfCost(HepRelVertex.java:63)
      at org.eigenbase.rel.metadata.RelMdPercentageOriginalRows.getNonCumulativeCost(RelMdPercentageOriginalRows.java:159)
      ... 62 more
      ```

      So it is where HepPlanner.dumpGraph() gets the cost of a RelNode.

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/julianhyde/optiq/issues/196
      Created by: bdumon
      Labels:
      Created at: Wed Mar 19 17:19:14 CET 2014
      State: closed

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              github-import GitHub Import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: