This topic provides details to verify that all expected tables have been successfully synced
after the initial automatic as well as the manual sync operations in IBM®
watsonx.data.
watsonx.data on IBM Software
Hub
Before you begin
- Install and activate Query optimizer manager in watsonx.data. See Activating Query optimizer in IBM watsonx.data.
- Names of catalogs and schemas for the tables being synced must be known.
- The expected number of tables within each schema must be known.
- Run the following command and record the table properties (such as number of rows) for
comparison in Step 5:
select count (*) from catalog.schema.table;
- If the session parameter
is_query_rewriter_plugin_enabled is set to
false, you will not be able to execute the
ExecuteWxdQueryOptimizer commands.
Procedure
- Log in to watsonx.data
console.
- Go to Query workspace and select Presto (C++) engine.
- Run the following command to retrieve a list of potential schema names:
ExecuteWxdQueryOptimizer 'select id_to_extsch(name) AS CATALOG_SCHEMA, name AS "SCHEMAID" from SYSIBM.sysschemata where name != qualifier1';
Select the correct schema name (case-sensitive) from the results.
- Run one of the following commands as needed:
- Run this command to count the number of tables within the specified
schema:
ExecuteWxdQueryOptimizer 'select count(1) AS schema_table_count from SYSIBM.SYSTABLES WHERE CREATOR=EXTSCH_TO_ID('catalog_name', 'schema_name')';
For example:
ExecuteWxdQueryOptimizer 'select count(1) AS schema_table_count from SYSIBM.SYSTABLES WHERE CREATOR=EXTSCH_TO_ID('sample_data', 'TPCDS_10GB')';
Compare the result of this query with the expected number of tables. If the counts match, it indicates that
all expected tables have been synced.
- Run this command to list all tables within the specified
schema:
ExecuteWxdQueryOptimizer 'SELECT NAME AS TABLE_NAME, id_to_extsch(creator) AS CATALOG_SCHEMA FROM SYSIBM.SYSTABLES WHERE CREATOR=EXTSCH_TO_ID('catalog_name', 'schema_name')';
For example:
ExecuteWxdQueryOptimizer 'SELECT NAME AS TABLE_NAME, id_to_extsch(creator) AS CATALOG_SCHEMA FROM SYSIBM.SYSTABLES WHERE CREATOR=EXTSCH_TO_ID('sample_data', 'TPCDS_10GB')';
- Run the following query to check table properties (such as number of
rows):
ExecuteWxdQueryOptimizer 'select name AS tablename, card from SYSIBM.SYSTABLES WHERE CREATOR=EXTSCH_TO_ID('catalog_name', 'schema_name')';
For example:
ExecuteWxdQueryOptimizer 'select name AS tablename, card from SYSIBM.SYSTABLES WHERE CREATOR=EXTSCH_TO_ID('sample_data', 'TPCDS_10GB')';