ZijieSong946 commented on pull request #12292: URL: https://github.com/apache/beam/pull/12292#issuecomment-662088537
I dug into this problem and figured out that we should avoid hitting into the operation simplification branch here (https://github.com/apache/calcite/blob/3530daaa8cad43aad6845b6c79e4bc1ca0e72f5f/core/src/main/java/org/apache/calcite/rex/RexSimplify.java#L325). For the current Calcite version we use (1.20), there is no check for `isDeterministic()`, it is added on Mar.6. (https://github.com/apache/calcite/pull/1818) So, we have to make `equals()` to be false. As for `RexLiteral.equals()`, it checks if the type and the value equals. (https://github.com/apache/calcite/blob/3530daaa8cad43aad6845b6c79e4bc1ca0e72f5f/core/src/main/java/org/apache/calcite/rex/RexLiteral.java#L1084-L1088) I decided to add a random parameter to the `Nan` wrapper function for make two `Nan` different in value to avoid operation simplification in Calcite. @robinyqiu @apilloud ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
