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 21:11:52 UTC

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

James-Jeyun-Kim commented on a change in pull request #2046:
URL: https://github.com/apache/calcite/pull/2046#discussion_r449267835



##########
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:
       You're right. I moved the test to SqlValidatorTest and made some adjustments accordingly.




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