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

  1. 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:
  2. 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.

  3. Run a tunnel command.
    Run the following tunnel command to import data to the MaxCompute client:
    tunnel upload D:\banking.txt bank_data;
    If OK (outlined in red in the following figure) is displayed, the data is uploaded.
  4. Verify the result.
    Use 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.
    • 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.