Jocean.shi> The result of this method is aways infinity Are you using Convention.NONE? VolcanoPlanner assigns infinite cost for all the relations with Logical convention (==Convention.NONE), so it is probably the reason.
If you want to perform cost-based optimization, you probably want to implement your own set of RelNodes and your own Convention. The relevant issue is https://issues.apache.org/jira/browse/CALCITE-2827 Vladimir
