Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CALCITE-4585]when run RelNode error,Confuse log info be thrown(xiong duan) #2402

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[CALCITE-4585] reformat exception message style
  • Loading branch information
NobiGo committed Apr 23, 2021
commit dae4bb0a66b9d0dee7e4ec5b042d606e14a16f68
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private CalcitePreparedStatement prepareStatement_(
} catch (Exception e) {
if (null != query.rel) {
throw Helper.INSTANCE.createException(
"Error while preparing statement [\n"
"Error while preparing statement [" + System.lineSeparator()
+ RelOptUtil.toString(query.rel) + "]", e);
} else {
throw Helper.INSTANCE.createException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,12 @@ private void runQuery(RelNode relNode) throws SQLException {
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"
+ " LogicalTableScan(table=[[test, entries]])\n"
+ "]"));
assertThat(
e.getMessage(), equalTo("java.sql.SQLException: "
+ "Error while preparing statement [" + System.lineSeparator()
+ "LogicalProject($f0=[ABS($1)])" + System.lineSeparator()
+ " LogicalTableScan(table=[[test, entries]])" + System.lineSeparator()
+ "]"));
}
}
}