Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-21404

Do not wrap SqlException into RuntimeException for PlannerHelper.optimize

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0-beta1
    • 3.0
    • jdbc, sql

    Description

      VolcanoRuleCall.java:250 wrap any exception into RuntimeException, so it can break UX for public API as the actual exception will be in cause

       

      Caused by: java.lang.RuntimeException: Error while applying rule ExposeIndexRule, args [rel#27:IgniteLogicalTableScan.NONE.[].any(table=[PUBLIC, TBL1],filters=AND(=($t2, _UTF-8'v'), =($t3, _UTF-8'v')),requiredColumns={0, 1, 2, 3})]
      	at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:250)
      	at org.apache.calcite.plan.volcano.TopDownRuleDriver.applyGenerator(TopDownRuleDriver.java:151)
      	at org.apache.calcite.plan.volcano.TopDownRuleDriver.access$600(TopDownRuleDriver.java:51)
      	at org.apache.calcite.plan.volcano.TopDownRuleDriver$ApplyRule.perform(TopDownRuleDriver.java:532)
      	at org.apache.calcite.plan.volcano.TopDownRuleDriver.drive(TopDownRuleDriver.java:109)
      	at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:524)
      	at org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:328)
      	at org.apache.ignite.internal.sql.engine.prepare.IgnitePlanner.transform(IgnitePlanner.java:386)
      	at org.apache.ignite.internal.sql.engine.prepare.PlannerHelper.optimize(PlannerHelper.java:125)
      	at org.apache.ignite.internal.sql.engine.planner.AbstractPlannerTest.physicalPlan(AbstractPlannerTest.java:384)
      	at org.apache.ignite.internal.sql.engine.planner.AbstractPlannerTest.physicalPlan(AbstractPlannerTest.java:372)
      	at org.apache.ignite.internal.sql.engine.planner.AbstractPlannerTest.physicalPlan(AbstractPlannerTest.java:356)
      	at org.apache.ignite.internal.sql.engine.planner.AbstractPlannerTest.physicalPlan(AbstractPlannerTest.java:344)
      	at org.apache.ignite.internal.sql.engine.planner.AbstractPlannerTest.physicalPlan(AbstractPlannerTest.java:333)
      	at org.apache.ignite.internal.sql.engine.planner.hints.ForceIndexHintPlannerTest.lambda$testWithMultipleIndexHints$0(ForceIndexHintPlannerTest.java:137)
      	at org.apache.ignite.internal.testframework.IgniteTestUtils.assertThrowsWithCause(IgniteTestUtils.java:313) 

      Steps to reproduce

       

      Replace 
      IgniteTestUtils.assertThrowsWithCause to assertThrowsSqlException
      For tests:
      HashIndexPlannerTest#testHashIndexIsNotAppliedWithoutConditions,
      HashIndexPlannerTest#hashIndexIsNotAppliedForRangeCondition
       
      Expected that SqlException will be thrown, not RuntimeException with SqlException as cause

      Attachments

        Issue Links

          Activity

            People

              mzhuravkov Maksim Zhuravkov
              anovikov Andrey Novikov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m