INSERT INTO SELECT errors, part 2: Store all errors in sys.errors (or similar)
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 616
- Avg merge
- 14h 49m
- Merged PRs (30d)
- 206
Description
### Problem Statement
This is a spinoff/continuation of #12218. (For estimation purposes assume that #12218 is done / a pre-requisite before this one.)
I wanted to capture this implementation alternative as a possible future improvement to the error handling:
***
Main user facing problem:
Confusion if some rows are not inserted (for example because of constraint violation).
Current behaviour: Errors are swallowed, number of successfully inserted rows is returned.
Implemented in #12218: Show first error and short circuit.
### Possible Solutions
Number of inserted rows is returned, errors aren’t swallowed but redirected to sys.operations
To lookup the errors, users need some identifier.
HTTP could include it in the response
for PG protocol we could implement session_id and users would lookup by session_id in sys.operations.
See https://github.com/crate/crate/issues/14939)
Question: Couldn't HTTP also have a session id? Seems like a generally useful concept that could be xpsed to users and used alost in sys.* tables.
### Considered Alternatives
https://github.com/crate/crate/issues/12218#issuecomment-2047795724
Contributor guide
Assessment
This issue has not been assessed yet.