Hi Jeremy, Please log a JIRA case and attach the stacktrace. Apart from the query it would help if you can provide the reproducer as a unit test in Calcite (e.g., in RelOptRulesTest [1]). Certain combinations of rules can lead to infinite rule matching.
Best, Stamatis [1] https://github.com/apache/calcite/blob/ea4a5f36085553d427a339270a6e0b9b844f2364/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java On Wed, Jan 5, 2022 at 4:57 PM Justin Swett <[email protected]> wrote: > Does it only happen with the full SQL statement or can you repro with > just one of those columns? S5, S6 and S7 seem like the fields that > might be problematic. > > On Wed, Jan 5, 2022 at 6:31 AM Jeremy Dyer <[email protected]> wrote: > > > > Hello, > > > > I am experiencing a java.lang.StackOverFlowError in the HepPlanner [1]. > The > > error is occurring in a unit test that had been working for some time > until > > I recently upgraded to Calcite 1.29.0. It is very possible I am doing > > something wrong in my planner configuration but I find it odd that it > > worked before the upgrade? The query is this [2]. Does anyone have ideas > > how I might resolve this issue? > > > > - Jeremy Dyer > > > > [1] > > > https://github.com/apache/calcite/blob/cbfe0609edcc4a843d71497f159e3687a834119e/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java#L391 > > > > [2] > > SELECT > > (CASE WHEN a = 3 THEN 1 END) AS "S1", > > (CASE WHEN a > 0 THEN a ELSE 1 END) AS "S2", > > (CASE WHEN a = 4 THEN 3 ELSE a + 1 END) AS "S3", > > (CASE WHEN a = 3 THEN 1 WHEN a > 0 THEN 2 ELSE a END) AS "S4", > > CASE > > WHEN (a >= 1 AND a < 2) OR (a > 2) THEN CAST('in-between' AS VARCHAR) > ELSE > > CAST('out-of-range' AS VARCHAR) > > END AS "S5", > > CASE > > WHEN (a < 2) OR (3 < a AND a < 4) THEN 42 ELSE 47 > > END AS "S6", > > CASE WHEN (1 < a AND a <= 4) THEN 1 ELSE 0 END AS "S7" > > FROM df >
