This topic describes how to import data to MaxCompute by running a tunnel command.
MaxCompute provides different methods for importing and exporting data. For more information about how to import data by running a tunnel command on the MaxCompute client, see Tunnel commands.
Run a tunnel command to import data
- Prepare the data.
Download the bank.txt file for this example and save it to D:\. This file contains the information such as the age, profession, and highest level of educational attainment of different people. The following is an example:
44,blue-collar,married,basic.4y,unknown,yes,no,cellular,aug,thu,210,1,999,0,nonexistent,1.4,93.444,-36.1,4.963,5228.1,0 53,technician,married,unknown,no,no,no,cellular,nov,fri,138,1,999,0,nonexistent,-0.1,93.2,-42,4.021,5195.8,0 28,management,single,university.degree,no,yes,no,cellular,jun,thu,339,3,6,2,success,-1.7,94.055,-39.8,0.729,4991.6,1
- Create a MaxCompute table.
Create a MaxCompute table to store the preceding data. If you have created a table according to Create and view a table, skip this step. In this example, the table is named bank_data.
- Run a tunnel command.
Run the following tunnel command to import data to the MaxCompute client:
If OK (outlined in red in the following figure) is displayed, the data is uploaded.
tunnel upload D:\banking.txt bank_data;
- Verify the result.
select count(*) from bank_data;to check whether all the records in the bank_data table are successfully uploaded. In this example, the table has 41,188 records in total.Note
- For more information about tunnel commands, for example, how to import data into a partitioned table, see Tunnel commands.
Other import methods
You can also import data to MaxCompute by using MaxCompute Studio, Tunnel SDK, data integration, or open-source applications such as Sqoop, Fluentd, Flume, and Logstash. For more information, see Data upload and download tools.
What to do next
After importing data to MaxCompute, you can run SQL statements to process the data in MaxCompute. For more information, see Run SQL statements and export data.