Related Documentation Download this Manual
PDF (US Ltr) - 2.1Mb
PDF (A4) - 2.1Mb


5.2.5.3 Generated Load Script

The following is a typical load script generated by the Auto Parallel Load process. It creates a schema, then creates a table with columns matching those found in the source bucket.

mysql> SELECT log->>"$.sql" AS "Load Script" 
        FROM sys.heatwave_autopilot_report 
        WHERE type = "sql" 
        ORDER BY id;

+--------------------------------------------------------------------------------------------------------------+
| Load Script                                                                                                  |
+--------------------------------------------------------------------------------------------------------------+
| CREATE DATABASE `tpch`;                                                                                      |
| CREATE TABLE `tpch`.`customer_csv`(                                                                          |
|   `C_CUSTKEY` int unsigned NOT NULL,                                                                         |
|   `C_NAME` varchar(19) NOT NULL COMMENT 'RAPID_COLUMN=ENCODING=VARLEN',                                      |
|   `C_ADDRESS` varchar(40) NOT NULL COMMENT 'RAPID_COLUMN=ENCODING=VARLEN',                                   |
|   `C_NATIONKEY` tinyint unsigned NOT NULL,                                                                   |
|   `C_PHONE` varchar(15) NOT NULL COMMENT 'RAPID_COLUMN=ENCODING=VARLEN',                                     |
|   `C_ACCTBAL` decimal(6,2) NOT NULL,                                                                         |
|   `C_MKTSEGMENT` varchar(10) NOT NULL COMMENT 'RAPID_COLUMN=ENCODING=VARLEN',                                |
|   `C_COMMENT` varchar(116) NOT NULL COMMENT 'RAPID_COLUMN=ENCODING=VARLEN'                                   |
| ) ENGINE=lakehouse SECONDARY_ENGINE=RAPID                                                                    |
|   ENGINE_ATTRIBUTE='{"file": [{"par": "https://objectstorage.../customer.csv"}],                             |
|                      "dialect": {"format": "csv", "field_delimiter": "|", "record_delimiter": "|\\n"}}';     |
| ALTER TABLE /*+ AUTOPILOT_DISABLE_CHECK */ `tpch`.`customer_csv` SECONDARY_LOAD;                             |
| CREATE TABLE `tpch`.`nation_json`(`col_1` json NOT NULL COMMENT 'RAPID_COLUMN=ENCODING=VARLEN')              |
| ENGINE=lakehouse SECONDARY_ENGINE=RAPID                                                                      |
| ENGINE_ATTRIBUTE='{"file": [{"par": "https://objectstorage.../nation.json"}],                                |
|                    "dialect": {"format": "json"}}';                                                          |
| ALTER TABLE /*+ AUTOPILOT_DISABLE_CHECK */ `tpch`.`nation_json` SECONDARY_LOAD;                              |
| CREATE TABLE `tpch`.`region_avro`(                                                                           |
|   `R_REGIONKEY` tinyint unsigned NOT NULL,                                                                   |
|   `R_NAME` varchar(11) NOT NULL COMMENT 'RAPID_COLUMN=ENCODING=VARLEN',                                      |
|   `R_COMMENT` varchar(115) NOT NULL COMMENT 'RAPID_COLUMN=ENCODING=VARLEN'                                   |
| ) ENGINE=lakehouse SECONDARY_ENGINE=RAPID                                                                    |
| ENGINE_ATTRIBUTE='{"file": [{"par": "https://objectstorage.../region.avro"}],                                |
|                    "dialect": {"format": "avro"}}';                                                          |
| ALTER TABLE /*+ AUTOPILOT_DISABLE_CHECK */ `tpch`.`region_avro` SECONDARY_LOAD;                              |
| CREATE TABLE `tpch`.`supplier_pq`(                                                                           |
|   `S_SUPPKEY` int,                                                                                           |
|   `S_NAME` varchar(19) COMMENT 'RAPID_COLUMN=ENCODING=VARLEN',                                               |
|   `S_ADDRESS` varchar(40) COMMENT 'RAPID_COLUMN=ENCODING=VARLEN',                                            |
|   `S_NATIONKEY` int,                                                                                         |
|   `S_PHONE` varchar(15) COMMENT 'RAPID_COLUMN=ENCODING=VARLEN',                                              |
|   `S_ACCTBAL` decimal(15,2),                                                                                 |
|   `S_COMMENT` varchar(100) COMMENT 'RAPID_COLUMN=ENCODING=VARLEN'                                            |
| ) ENGINE=lakehouse SECONDARY_ENGINE=RAPID                                                                    |
| ENGINE_ATTRIBUTE='{"file": [{"prefix": "src_data/parquet/tpch/supplier/",                                    |
|                              "bucket": "myBucket",                                                           |
|                              "namespace": "myNamespace",                                                     |
|                              "region": "myRegion"}],                                                         |
|                    "dialect": {"format": "parquet"}}';                                                       |
| ALTER TABLE /*+ AUTOPILOT_DISABLE_CHECK */ `tpch`.`supplier_pq` SECONDARY_LOAD;                              |
+--------------------------------------------------------------------------------------------------------------+
Note

The output above is displayed in a readable format. The actual CREATE TABLE output is generated on a single line.