Konstantin Orlov created IGNITE-24616:
-----------------------------------------

             Summary: Sql. Improve error reporting in SqlLogic test runner
                 Key: IGNITE-24616
                 URL: https://issues.apache.org/jira/browse/IGNITE-24616
             Project: Ignite
          Issue Type: Improvement
          Components: sql
            Reporter: Konstantin Orlov
            Assignee: Konstantin Orlov


Currently, only error message is printed out to log in case of unsuccessful 
error matching. This leaves us no chance to understand what had happened in the 
first place. Take a look at example below:
{code:java}
java.lang.AssertionError: Not expected result at: 
(test_not_null_constraint.test:163). Statement: MERGE INTO t2 dst USING t1 src 
ON dst.id = src.id WHEN MATCHED THEN UPDATE SET val = NULL. Expected: Column 
'VAL' does not allow NULLs
Expected: a string containing "Column 'VAL' does not allow NULLs"
     but: was null
java.lang.AssertionError: Not expected result at: 
(test_not_null_constraint.test:163). Statement: MERGE INTO t2 dst USING t1 src 
ON dst.id = src.id WHEN MATCHED THEN UPDATE SET val = NULL. Expected: Column 
'VAL' does not allow NULLs
Expected: a string containing "Column 'VAL' does not allow NULLs"
     but: was null
  at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
  at 
org.apache.ignite.internal.sql.sqllogic.Statement.execute(Statement.java:123)
  at 
org.apache.ignite.internal.sql.sqllogic.SqlScriptRunner.run(SqlScriptRunner.java:70)
  at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  at java.base/java.lang.Thread.run(Thread.java:833)
{code}
The root cause may be an assertion, an NPE, or any other exception without 
message provided.

Let's improve error reporting in case of unsuccessful matching, printing out 
stack trace of actual exception.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to