You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Andrey Novikov (Jira)" <ji...@apache.org> on 2024/01/31 11:07:00 UTC

[jira] [Created] (IGNITE-21404) Do not wrap SqlException into RuntimeException for PlannerHelper.optimize

Andrey Novikov created IGNITE-21404:
---------------------------------------

             Summary: Do not wrap SqlException into RuntimeException for PlannerHelper.optimize
                 Key: IGNITE-21404
                 URL: https://issues.apache.org/jira/browse/IGNITE-21404
             Project: Ignite
          Issue Type: Improvement
          Components: jdbc, sql
    Affects Versions: 3.0.0-beta1
            Reporter: Andrey Novikov


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

 
{code:java}
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) {code}
h3. 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)