crate / crate/crate

INSERT INTO SELECT errors, part 2: Store all errors in sys.errors (or similar)

Open
#17,604 2 comments 0 reactions 0 assignees View on GitHub
complexity: no estimate feature: ux needs discussion
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.