The SHOW INSPECT ERRORS statement displays errors recorded by an INSPECT job, including background INSPECT jobs triggered by IMPORT INTO row count validation.
SHOW INSPECT ERRORS shows results for a single INSPECT job at a time; it does not aggregate results across jobs. To view errors from a specific job, including an inspect_job_id returned by IMPORT INTO, use SHOW INSPECT ERRORS FOR JOB {job_id}.
Required privileges
To run SHOW INSPECT ERRORS, the user must have:
- The
INSPECTsystem-level privilege, which is required to run theINSPECTstatement.
Synopsis
Parameters
| Parameter | Syntax | Description |
|---|---|---|
opt_for_table_clause |
FOR TABLE {table_name} |
Optional. Show errors for the specified table. |
opt_for_job_clause |
FOR JOB {job_id} |
Optional. Show errors produced by the specified job ID, such as a job ID returned by the INSPECT statement or the inspect_job_id returned by IMPORT INTO. |
opt_with_details |
WITH DETAILS |
Optional. Include structured error metadata from the details column (JSON) in the results. |
Response
SHOW INSPECT ERRORS returns the following columns, with one row per issue detected.
| Field | Description |
|---|---|
error_type |
The type of inconsistency detected. For more information, see Error types. |
database_name |
The database containing the schema object with an issue. |
schema_name |
The schema containing the object with an issue. |
table_name |
The table with an issue. |
primary_key |
The primary key of the row involved in the issue, if applicable. |
job_id |
The ID of the INSPECT job that detected the issue. |
aost |
The AS OF SYSTEM TIME timestamp used by the validation job (if any). |
details |
This column is present only if WITH DETAILS is specified. It contains structured metadata (JSON) describing the issue. |
Error types
The INSPECT implementation reports the following error_type values:
| Error type | Meaning |
|---|---|
missing_secondary_index_entry |
A row in the primary index is missing a corresponding entry in a secondary index. If you see this error, contact Support. |
dangling_secondary_index_entry |
A secondary index entry exists, but the referenced primary index row does not. If you see this error, contact Support. |
internal_error |
An error occurred while INSPECT was running its validation queries (for example, an MVCC GC timeout). The cause of this error type is usually not related to data validity. Investigate the underlying job error details and cluster logs to determine the cause before deciding whether to contact Support. |
row_count_mismatch |
The row count observed by INSPECT did not match the expected row count. This can occur in the post-import validation job triggered by IMPORT INTO. Use WITH DETAILS to compare the expected and actual counts. |
duplicate_unique_value |
INSPECT found a duplicate value in a supported REGIONAL BY ROW uniqueness check. Use WITH DETAILS to see the index_name and remote_regions metadata for the duplicate. |
Examples
Show the latest errors for a table
To see the errors found by the most recent INSPECT job, issue the following statement:
SHOW INSPECT ERRORS FOR TABLE movr.public.users;
Show errors for a specific inspection job
When you issue the INSPECT statement, a NOTICE message is returned to the client showing the job ID, e.g.,
INSPECT TABLE movr.public.users AS OF SYSTEM TIME '-10s';
NOTICE: waiting for INSPECT job to complete: 1141477013029322753
If the statement is canceled, the job will continue in the background.
To show errors for a job, issue the following statement:
SHOW INSPECT ERRORS FOR JOB 1141477013029322753;
If IMPORT INTO returns an inspect_job_id value for its post-import validation job, you can use that value with SHOW INSPECT ERRORS FOR JOB {inspect_job_id} as well.
If there are no errors associated with that job ID, the output is:
SHOW INSPECT ERRORS 0
Note that if you issue a job ID for a nonexistent job, you will see the same output as for a job with no errors:
SHOW INSPECT ERRORS FOR JOB 0;
SHOW INSPECT ERRORS 0
Show errors with details
SHOW INSPECT ERRORS FOR TABLE movr.public.users WITH DETAILS;