>From a quick look it seems a bit weird that RelCollationTraitDef.INSTANCE is not registered in the planer [1] and at the same time somebody imposes sorteness requirements (i.e., sort=[0, 1]) on the final plan [2]. Not sure if that is the problem but certain rules such as SortRemoveRule [3] do require this trait definition to be present in order to work so it may be a good idea to add it.
Best, Stamatis [1] https://github.com/ralotaib/calciteTesting/blob/f1f5f62e9201694da92270327addf9c5d6504981/SampleTestingCalcite/src/main/java/calcite/test/tpcds/SQL2Log.java#L109 [2] https://github.com/ralotaib/calciteTesting/blob/f1f5f62e9201694da92270327addf9c5d6504981/SampleTestingCalcite/Query06-Exception#L1 [3] https://github.com/ralotaib/calciteTesting/blob/f1f5f62e9201694da92270327addf9c5d6504981/SampleTestingCalcite/src/main/java/calcite/test/tpcds/utils/PlannerUtil.java#L20 On Wed, Jul 21, 2021 at 6:41 PM Rana Alotaibi <[email protected]> wrote: > Thank you Roman and Stamatis for your prompt response. Here is the link to > the code: CalcitePlannerTest > < > https://github.com/ralotaib/calciteTesting/blob/main/SampleTestingCalcite/src/main/java/calcite/test/tpcds/TestPlannerGeneral.java > >. > Also, here is the link to the long debugging information: Query Exception > < > https://github.com/ralotaib/calciteTesting/blob/main/SampleTestingCalcite/Query06-Exception > > > . > > Many thanks, > Rana > > > > On Wed, Jul 21, 2021 at 2:19 AM Stamatis Zampetakis <[email protected]> > wrote: > > > Hi Rana, > > > > As Roman, pointed out we will need a bit more information to know what > > happened. > > If you can share a link to the code that you used to run the TPC-DS > queries > > that would be great. > > > > The most common cause for this exception is a missing rule to go from > > logical to physical operator (Enumerable). > > In some cases the Volcano planner may be used to apply only > transformation > > rules going from logical to logical. > > In that case the appropriate flag should be set in the Volcano planner > [1]. > > > > Best, > > Stamatis > > > > [1] > > > > > https://github.com/apache/calcite/blob/3c4dd308fe8f836ef63592bdb9045af0d0400ddf/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java#L715 > > > > On Wed, Jul 21, 2021 at 4:44 AM Roman Kondakov > <[email protected] > > > > > wrote: > > > > > Hi Rana, > > > > > > there also should be a debugging information included into the > > > exception: long list of sets, subsets and relational nodes. Could you > > > please send it? > > > > > > Roman Kondakov > > > > > > On 21.07.2021 09:27, Rana Alotaibi wrote: > > > > Hi Calcite Dev, Thanks for Calcite! > > > > > > > > I'm currently using Calcite Core and Plus 1.27.0. I got the > following > > > > exception when I tried to get the logical plans of 18 out of 99 > TPC-DS > > > > queries: > > > > > > > > "There are not enough rules to produce a node with desired > properties:" > > > > > > > > I attached a sample code that I used when I tried to get the logical > > > > plan of TPC -DS query 6. The exact exception for that query is: > > > > > > > > "Exception in thread "main" > > > > org.apache.calcite.plan.RelOptPlanner$CannotPlanException: There are > > not > > > > enough rules to produce a node with desired properties: > > > > convention=ENUMERABLE, sort=[0, 1]. > > > > Missing conversions are LogicalAggregate[convention: NONE -> > > ENUMERABLE, > > > > sort: [] -> [0]], LogicalAggregate[convention: NONE -> ENUMERABLE], > > > > LogicalProject[convention: NONE -> ENUMERABLE, sort: [] -> [94]]" > > > > > > > > I was wondering if there is some planner setup or configurations > that I > > > > missed > > > > > > > > Many thanks, > > > > Rana > > > > > > > > > > > > > > > > > > > > > >
