Yep, the error is clear.
But I can't find any way to create an accessor to dynamic parameters as Expression.
It seems that Expressions.dynamic() is not implemented and there is not used full method in RexToLixTranslator to achieve the goal, I am tring to write is but there is a lot of stuff to learn.
Do I have to implement such support ? I see in RexToLixTranslator that some support for dynamic parameters is already present.
For the scope of my urgent needs the patch is working, because I only use the planner.
If it is a big change as there is no such support dyn parameters in Expressions and you need to close 1.15 next week I propose to split this issue in two parts, merge this part in 1.15 and I volounteer to finish the work as soon as possible but it will go to 1.16.
The support for dynamic limits in planner for me is really important as it is used in YCSB for benchmarks.
I will continue my search for the best implementation, maybe the impl is trivial but I am a newbie to Calcite codebase