CHECK TABLE Syntax
CHECK TABLE loads every column of each table into memory, checking
large tables can take a long time and can displace data that other queries are
using. Queries can read a table while it is being checked, but some changes to
the table wait until its check is complete. Consider checking large tables,
or all tables with *, during a period of low activity.
Parameters
<schema name>
<schema name>
Name of the schema containing the table to check
<table name>
<table name>
Name of the table to check; multiple tables can be given as a comma-separated list
*
*
Check all tables
WITH OPTIONS
WITH OPTIONS
Optional indicator that a comma-delimited list of option/value assignments will follow; see
the options below
Options
LOCAL_ONLY
LOCAL_ONLY
If
true, only check column data that has a copy in the local
persist tier; data held only in cold storage is skipped,
and so is not checked. The default is false, which downloads data held only in cold
storage in order to check it.SHOW_DETAIL
SHOW_DETAIL
If
true (the default), report each corrupted chunk individually. If false, report only
a count of the corrupted chunks found for each table at each location.Response
CHECK TABLE returns rows only for tables with corrupted data; a table
with no corruption produces no rows. By default, each row describes one
corrupted chunk; with SHOW_DETAIL set to false, each row summarizes the
corrupted chunks of one table at one location.
Examples
To check two tables for corrupted data:CHECK TABLE Example
CHECK TABLE with Options Example