DataWorks DataStudio lets you upload data from local CSV or custom text files directly to MaxCompute tables. This topic describes the procedure.
Prerequisites
Create a MaxCompute development table to receive the local data. For more information about how to create a table, see Create and use MaxCompute tables.
Limitations
In DataStudio, you can upload data to MaxCompute tables only from local CSV or text files. Uploading SQL files is not supported.
For more advanced data upload features, you can use the Upload and Download module in DataWorks. This module supports uploading data from various sources, such as local files, spreadsheets, and Object Storage Service (OSS) files, to engines like MaxCompute, E-MapReduce (EMR) Hive, and Hologres. For more information, see Data upload.
Entry points
You can start the data import process from the following locations:
-
On the Data Studio page, click the import icon in the top toolbar, located to the left of the + New button.
-
From a table group under a . In the left-side navigation pane, click DataStudio, and expand the directory tree. For example, expand a path such as Your-Business-Flow > MaxCompute > Your-Project > DataStudio > Tables. Right-click the Tables node and select Import Data.
-
In standard mode, go to the Table Management page, right-click a development table, and select Import Data.
Procedure
In DataStudio, you can upload data to MaxCompute tables only from local CSV or text files. Uploading SQL files is not supported.
-
Open the data import dialog box using one of the entry points from the previous section.
-
In the Data Import Wizard dialog box, specify the destination development table. Verify the table information, then click Next.
If the selected table is a partitioned table, you can specify the destination partition. After specifying the partition, click Check to verify that it exists.
-
If the specified partition does not exist, the system creates a new one and inserts the data.
-
If the specified partition already exists, the system appends the uploaded data to it.
-
-
Select the data file to import and configure the file format.
Upload the source file, configure parameters such as the delimiter and character set, and then click Next.
The following table describes the key parameters.
Parameter
Description
File Format
Select the format of the file that you want to upload. Supported formats are CSV and Custom Text File. The Custom Text File option supports files with
.txt,.csv, and.logextensions.Select file
Click Browse and select the file to upload.
Select Delimiter
Select the delimiter used to separate fields in your data. Supported delimiters include
comma (,),Tab,semicolon (;),space,|,#, and&.NoteFor custom text files, you can also define a custom field delimiter.
Original Character Set
Select the character set of the source file. Supported character sets include GBK, UTF-8, CP936, and ISO-8859-1.
Import First Row
Specify the line number of the source file from which to start importing data.
First Row as Field Names
Specifies whether to treat the first row of the source file as a header.
-
If you select Yes, the system treats the first row as a header and does not import it.
-
If you do not select this option, the system imports the first row as data.
-
-
Select a mapping method between the source fields and destination columns, then click Import Data.
You can map the source data to the MaxCompute table columns by position or by name.
After the import is complete, a success message appears. To view the imported data, create an ad hoc query. For more information, see Create an ad hoc query.
Related topics
For more advanced data upload features, you can use the Upload and Download module in DataWorks. This module supports uploading data from various sources, such as local files, spreadsheets, and Object Storage Service (OSS) files, to engines like MaxCompute, E-MapReduce (EMR) Hive, and Hologres. For more information, see Data upload.