mihaibudiu commented on PR #3635: URL: https://github.com/apache/calcite/pull/3635#issuecomment-1939616304
These are very good questions. Indeed, this PR the "Enumerable" implementation. But that implementation is special, because it is the one used when Calcite optimizations simplify a query plan. In particular, the optimization rule PROJECT_REDUCE_EXPRESSIONS uses this code to simplify constant expressions. As far as I understand, the behavior of built-in SQL functions and casts in Calcite is *not* configurable to depend on the dialect being compiled. If you want a different behavior of these casts in different dialects the only solution may be to never let Calcite simplify the code (assuming that is possible - I don't understand all the paths on which code is simplified, some simplifications are used even when you do not use PROJECT_REDUCE_EXPRESSIONS). If you can avoid Calcite optimizing these cases, then the cast implementation is purely a question of what your runtime chooses to do. Another alternative would be to indeed "override" the function I wrote stringToBinary, but I don't see how you can do this in a dialect-dependent version. Perhaps someone more knowledgeable (@julianhyde?) about the Calcite architecture can answer this question: "can the behavior of a cast made to be dialect-dependent?" If yes, what is the right way to do it? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
