This topic describes how to use Tunnel to upload log data to MaxCompute.


Background information

Tunnel is a tool that can be used to upload large volumes of data to MaxCompute at a time. It is suitable for offline computing. For more information, seeTunnel command usage.


  1. On the odpscmd client, run the following commands to create a table namedloghubthat is used to store the uploaded data:
    Enable the new data types supported by MaxCompute V2.0. Commit the following command with the SQL statement that is used to create the table:
    set odps.sql.type.system.odps2=true;
    -- Create a table named loghub.
    CREATE TABLE loghub
    client_ip   STRING ,
    receive_time STRING ,
    topic STRING,
    id STRING,
    name VARCHAR(32),
    salenum STRING
  2. Run the following command to upload log data to MaxCompute:
    Tunnel u D:\loghub.csv loghub;
    • D:\loghub.csv: specifies the path where the log data file is stored.
    • loghub: specifies the name of the MaxCompute table that is used to store log data.
    Note Wildcards or regular expressions are not supported for Tunnel-based data uploads.
  3. Execute the following statement to check whether the data is uploaded to the table:
    SELECT * FROM loghub;
    If the result shown in the following figure is displayed, the data is uploaded.Query result