Export full data to S3
This topic describes how to use the LTS console to create and manage full data export tasks from Lindorm to AWS S3. This feature allows you to export data from Lindorm to AWS S3 in multiple file formats with flexible export configurations.
Prerequisites
System requirements
-
LTS engine and compute engine are activated.
-
Wide table snapshot configuration is enabled. Contact LTS support to enable this feature.
-
The LTS engine version is 3.9.4 or later, and the feature is hot-upgraded by LTS support. The upgrade does not affect other engine services.
-
Network connectivity between the source Lindorm instance and the target S3 bucket is established.
Permission requirements
-
Lindorm data source permissions: The account configured in the job can access the tables to be exported.
-
S3 permissions: The AWS account or IAM user has read and write permissions on the target bucket.
Procedure
Step 1: Configure data sources
Access the LTS console from the Lindorm console.
Create data sources
Create Lindorm, Spark, and S3 data sources (all three are required):
-
Create a Lindorm wide table data source. For more information, see Add a LindormTable data source.
-
Create a Spark data source. For more information, see Add a Spark data source.
-
Create an S3 data source. For more information, see Add an S3 data source.
Create an export task
-
Select the Lindorm instance from which you want to export data from the Source Data Source drop-down list.
-
Select the configured S3 data source from the Destination Data Source drop-down list.
Set the file type
Available file types:
-
CSV: Suitable for text data and general scenarios.
-
Parquet: Suitable for big data analysis scenarios with columnar storage.
-
ORC: Suitable for high-performance query scenarios.
Configure the bucket path
Specify the target bucket path for the exported files. When the destination data source is S3, the bucket path format is s3a://your-s3-bucket/export-data.
-
The bucket exists.
-
The current account has write permissions.
-
The bucket region is network-reachable.
Step 2: Configure the export
Two export configuration methods are available. Select one:
-
To export entire tables, namespaces, or databases, you do not need to enter SQL statements. This method does not support computation and only supports 1:1 export of all table fields (only SQL tables with non-dynamic columns are supported).
-
To use SQL filter statements, you do not need to select tables. Use the syntax
select xx from database.table_name where xx. This method supports custom SQL for data filtering and ETL computation.
Option A: Table specification
Examples:
-
*: Export all tables from the entire Lindorm instance. -
test_ns:*: Export all tables under the test_ns namespace. -
test_ns:user_info: Export only the user_info table.
Option B: SQL statements
Dangerous statements such as DROP, DELETE, and TRUNCATE are not allowed. These statements are validated and rejected.
Syntax requirement: Spark SQL. Example:
INSERT OVERWRITE DIRECTORY 's3a://your-bucket/lindorm2s3/{namespace}/{tablename}/{ts}' USING CSV SELECT * FROM {namespace}.`{tablename}`
Step 3: Configure Spark parameters
Executor instances
-
Field: Number of Executors
-
Description: The number of Spark executor instances. Default: 1 executor (4 concurrent threads reading from the upstream wide table).
-
Impact: More instances increase parallelism and export speed but may affect the source instance. We recommend that you use the default value (1 executor) and adjust based on source monitoring.
Additional Spark parameters (optional)
Used to optimize Spark job performance. Not required by default.
Step 4: Submit the task
Before submission, the system automatically validates the following:
-
Required fields are complete.
-
Data source connections are normal.
-
S3 bucket permissions are sufficient.
-
Table specifications or SQL syntax are correct.
Click Create at the bottom of the page to submit the task.
-
Success: Automatically redirected to the task list page.
-
Failure: An error message is displayed. Fix the configuration as prompted.
Task monitoring and management
-
RUNNING: The task is in progress.
-
SUCCESS: The task completed successfully.
-
FAILED: The task failed.
-
KILLED: The task was terminated.
Click a task to view the execution progress, data volume, execution logs, and error messages. You need the database account credentials (available in the console) to view details.
Export file structure
Default storage path format:
s3a://{bucket}/lindorm2s3/{namespace}/{table}/{timestamp}/
To customize the path, use the SQL method.
File organization example:
lindorm2s3/
├── namespace1/
│ ├── table1/
│ │ └── 20240101_120000/
│ │ ├── part-00000.csv
│ │ ├── part-00001.csv
│ │ └── _SUCCESS
│ └── table2/
│ └── 20240101_120000/
└── namespace2/
└── table1/
└── 20240101_120000/