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


Reply via email to