You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2022/10/14 18:31:21 UTC

[GitHub] [calcite] julianhyde commented on a diff in pull request #2853: [CALCITE-4632] SARG datatype should be less restictive than any of the input types

julianhyde commented on code in PR #2853:
URL: https://github.com/apache/calcite/pull/2853#discussion_r996031793


##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -1258,6 +1259,26 @@ private static String toSql(RelNode root, SqlDialect dialect,
     relFn(relFn).optimize(rules, null).ok(expected);
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4632">[CALCITE-4632]
+   * Find the least restrictive datatype for SARG</a>. */
+  @Test void testLeastRestrictiveTypeForSarg() {
+    final Function<RelBuilder, RelNode> relFn = b -> b
+        .scan("EMP")
+        .filter(
+            b.or(b.isNull(b.field("COMM")),
+                  b.in(
+                  b.field("COMM"),
+                  b.literal(new BigDecimal("1.0")), b.literal(new BigDecimal("20000.0")))
+            )
+        )

Review Comment:
   Please remove newlines before close-parentheses. This is not Calcite's coding style.



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org