Stage
On this page
Stage is a storage service that helps you organize and manage local files for ingestion into your SingleStoreDB Cloud database(s).
Note
The workspace group must be running SingleStoreDB version 8.
Upload a File
To upload a file in a Stage:
-
Select <your_
workspace_ group> -> Stages -> Upload New File. -
In the Upload File dialog, either drag and drop a file to the dialog or select Browse File.
-
Once the file is loaded, select Upload File.
Create a Folder
-
Select <your_
workspace_ group> -> Stages. -
Select the dropdown next to the Upload New File button, and select Create New Folder from the list.
-
In the Create New Folder dialog, enter a name for the folder, and select Create New Folder.
Ingest a File using Stage
Files can be ingested into a database from a Stage using the Cloud Portal or a pipeline.
Using the Cloud Portal
-
Under Stages, select the three dots in the Actions column of the file to upload, and then select Load To Database.
-
In the Load Data dialog, from the Choose Workspace list, select a workspace.
-
From the Choose a database list, select a database.
-
In the Table box, select an existing table or enter a new table name.
-
Select the Generate Notebook button.
A notebook is created, which shows the breakdown of all the queries that may be loaded with the notebook. You may edit the queries in the notebook to include different column names, column types, etc.
-
Select Run > Run All Cells.
-
Run the Check that the data has loaded cell to verify the loaded data.
Using Pipelines
Create a table with a structure that can store the data from the file.CREATE PIPELINE
syntax to load a file from a Stage:
CREATE PIPELINE <pipeline_name>AS LOAD DATA STAGE <path_in_Stage/filename> { <pipeline_options> }INTO TABLE <table_name>{ <data_format_options> }
Once the table and pipeline are created, start the pipeline.
Here's a sample CREATE PIPELINE
statement that loads data from a CSV file:
CREATE PIPELINE dbTest.plTestAS LOAD DATA STAGE 'data.csv'BATCH_INTERVAL 2500SKIP DUPLICATE KEY ERRORSINTO TABLE t1FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\'LINES TERMINATED BY '\n' STARTING BY ''FORMAT CSV;
Export SQL Results to a Stage
SQL results may be exported to a Stage as follows:
SELECT * FROM <table_name> GROUP BY 1 INTO STAGE '<table_results.csv>';
Use the GROUP BY 1
clause to avoid getting multiple files from each leaf node.
Supported Files
The Stage storage service supports the following file formats:
CSV |
SQL |
JSON |
Parquet |
GZ |
Zstd |
Snappy |
Storage Limits
Each Stage can have up to 10GB of storage for free.
Last modified: October 9, 2023