Run Auto Unload in dryrun
mode first to check
for errors and warnings and to inspect the generated unload
script. To unload a single schema in
dryrun
mode:
mysql> CALL sys.heatwave_unload(JSON_ARRAY("tpch"), JSON_OBJECT("mode","dryrun"));
In dryrun
mode, Auto Unload sends the unload
script to the heatwave_autopilot_report
table only. See
Section 2.7.9, “Autopilot Report Table”.
If Auto Unload fails with an error, inspect the errors with a query
to the heatwave_autopilot_report
table.
mysql> SELECT log FROM sys.heatwave_autopilot_report
WHERE type="error";
When Auto Unload finishes running, query the
heatwave_autopilot_report
table to check
for warnings.
mysql> SELECT log FROM sys.heatwave_autopilot_report
WHERE type="warn";
Issue the following query to inspect the unload script that was generated.
mysql> SELECT log->>"$.sql" AS "Unload Script"
FROM sys.heatwave_autopilot_report
WHERE type = "sql" ORDER BY id;
Once you are satisfied with the Auto Unload
CALL
statement and the
generated unload script, reissue the
CALL
statement in
normal
mode to unload the data into
HeatWave. For example:
mysql> CALL sys.heatwave_unload(JSON_ARRAY("tpch"), JSON_OBJECT("mode","normal"));
Retrieve DDL statements in a table or use the following statements to produce a list of DDL statements to easily copy and paste.
mysql> SET SESSION group_concat_max_len = 1000000;
mysql> SELECT GROUP_CONCAT(log->>"$.sql" SEPARATOR ' ')
FROM sys.heatwave_autopilot_report
WHERE type = "sql" ORDER BY id;
The time required to unload data depends on the data size.
Tables are unloaded in sequence, ordered by schema and table name. Unload-time errors are reported as they are encountered. If an error is encountered while unloading a table, the operation is not terminated. Auto Unload continues running, moving on to the next table.
When Auto Unload finishes running, it checks if tables are unloaded and shows a summary with the number of tables that were unloaded and the number of tables that failed to unload.