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/23 07:35:00 UTC

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

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



##########
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:
       Statement in Calcite may be  include three types: Sql. RelNode .  Queryable.  This method Called prepareStatement_. My be we listen to others opinion.




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