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 2020/07/02 20:29:42 UTC

[GitHub] [calcite] laurentgo commented on a change in pull request #2046: [CALCITE-4092] NPE using WITH clause without a corresponding SELECT FROM (James Kim)

laurentgo commented on a change in pull request #2046:
URL: https://github.com/apache/calcite/pull/2046#discussion_r449251024



##########
File path: core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java
##########
@@ -875,6 +877,20 @@ public final Sql sql(String sql) {
     sql(sql).ok();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4092">[CALCITE-4092]
+   * NPE using WITH clause without a corresponding SELECT FROM</a>. */
+  @Test void testWithNotSelected() {
+    final String sql = "with emp2 as (select max(empno) as empno from emp where empno > 10)\n"
+        + "select * from emp where empno < emp2.empno";
+    try {
+      sql(sql).ok();

Review comment:
       This test probably belongs more to `SqlValidatorTest` which has support to test for error (and validate error messages).`




----------------------------------------------------------------
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:
users@infra.apache.org