danny0405 commented on a change in pull request #1282: [CALCITE-3151] RexCall's 
Monotonicity is not considered in determinin…
URL: https://github.com/apache/calcite/pull/1282#discussion_r298445538
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
 ##########
 @@ -5580,6 +5586,49 @@ private Sql checkSubQuery(String sql) {
         .withPre(preProgram).with(program).check();
   }
 
+  @Test public void testMonotonicityUDF() throws Exception {
+    final SqlFunction monotonicityFun =
+        new SqlFunction("MONOFUN", SqlKind.OTHER_FUNCTION, ReturnTypes.BIGINT, 
null,
+            OperandTypes.NILADIC, SqlFunctionCategory.USER_DEFINED_FUNCTION) {
+          @Override public boolean isDeterministic() {
+            return false;
+          }
+
+          @Override public SqlMonotonicity getMonotonicity(SqlOperatorBinding 
call) {
+            return SqlMonotonicity.INCREASING;
+          }
+        };
+
+    // Build a tree equivalent to the SQL
+    //  SELECT sal, MONOFUN() AS n FROM emp
 
 Review comment:
   nit: the redundant whitespace

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to