This topic describes how to use Tunnel to upload log data to MaxCompute.
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.
- 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 );
- Run the following command to upload log data to MaxCompute:
Tunnel u D:\loghub.csv loghub;where,
Note Wildcards or regular expressions are not supported for Tunnel-based data uploads.
- 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.
- 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.