alamb commented on code in PR #27217:
URL: https://github.com/apache/datafusion/pull/27217#discussion_r4506089145


##########
datafusion/sqllogictest/README.md:
##########
@@ -166,6 +166,30 @@ SELECT * from foo;
 
 Assuming it looks good, check it in!
 
+## Cookbook: Testing errors
+
+To check an error message, write it as plain text after `----`:
+
+```text
+statement error
+SELECT * FROM no_such_table;
+----
+DataFusion error: Error during planning: table 
'datafusion.public.no_such_table' not found
+
+
+```
+
+The message must match exactly, and the block must end with **two** blank
+lines. With only one, the next record is read as part of the expected error:
+the test fails, and `--complete` deletes that record from the file.
+
+To fill in the message, write the query, then `----` and two blank lines, and
+run `--complete`. Avoid writing the message on the `statement error` line

Review Comment:
   i think rather than trying to explain what not to do here in words, it would 
be clearer as an example of what not to do , like
   
   ```sql
   statement error: `TopK\(fetch=1\)
   SELECT * FROM no_such_table;
   ```



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to