0

enter image description here java.lang.IllegalArgumentException: cannot move to STATE_2_READY from STATE_5_CONVERTED

at org.apache.calcite.prepare.PlannerImpl.ensure(PlannerImpl.java:148)
at org.apache.calcite.prepare.PlannerImpl.parse(PlannerImpl.java:212)
at org.apache.calcite.tools.Planner.parse(Planner.java:50)
at com.sql.calcite.hbase.driver.SqlHepTest.doParse(SqlHepTest.java:102)
at com.sql.calcite.hbase.driver.SqlHepTest.parseDataLineage(SqlHepTest.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)

I call reset () every time to reset the calcite planner, but there is an illegal state transitions

1 Answers1

0

Can't answer for sure since you didn't provide code, but I have come across similar error before.

Planner tool (not to be confused with physical/logical plans) is NOT thread safe. Even if you're calling reset(), it's likely that you are trying to use the same Planner from different threads. Instead of doing this, just instantiate a new Planner for each query. Way less headache.

Oscar
  • 1
  • 3