I see. Thanks, Jinfeng Ni! Anyway, if we look at the code I referred, the two things I pointed out are still true:
1. If you cannot find it in CalciteSchema's function map (i.e., cache), and call SimpleCalciteSchema. getImplicitTableBasedOnNullaryFunction, the "tableName" parameter should be used, otherwise the Schema.getFunctionNames can return whatever functions that can be totally not related to searched function name.
2. I assume SimpleCalciteSchema. getImplicitTableBasedOnNullaryFunction would have very similar implementation to that of SimpleCalciteSchema.getImplicitTable and SimpleCalciteSchema.getImplicitSubSchema, only that getImplicitTableBasedOnNullaryFunction is to search in functions while the latter two in tables and sub-schemas.