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 2021/04/26 02:49:49 UTC

[GitHub] [calcite] Aaaaaaron commented on a change in pull request #2402: [CALCITE-4585]when run RelNode or Queryable,Confuse log info be thrown(xiong duan)

Aaaaaaron commented on a change in pull request #2402:
URL: https://github.com/apache/calcite/pull/2402#discussion_r619939520



##########
File path: core/src/test/java/org/apache/calcite/test/ExceptionMessageTest.java
##########
@@ -141,4 +167,29 @@ private void runQuery(String sql) throws SQLException {
           containsString("Object 'nonexistentTable' not found"));
     }
   }
+
+  @Test void testValidRelNodeQuery() throws SQLException {
+    final RelNode relNode = builder
+        .scan("test", "entries")
+        .project(builder.field("name"))
+        .build();
+    runQuery(relNode);
+  }
+
+  @Test void testRelNodeQueryException() throws SQLException {
+    try {
+      final RelNode relNode = builder
+          .scan("test", "entries")
+          .project(builder.call(SqlStdOperatorTable.ABS, builder.field("name")))
+          .build();
+      runQuery(relNode);
+      fail("Query badEntries should result in an exception");
+    } catch (RuntimeException e) {
+      assertThat(e.getMessage(),
+          equalTo("java.sql.SQLException: Error while preparing statement [\n"
+              + "LogicalProject($f0=[ABS($1)])\n"

Review comment:
       Actually, I'm +1 for Danny, maybe change "statement" to "plan" is better. But the code before is also "Error while preparing statement"




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