Import local data

    Unlike the submission methods of other commands, Stream Load communicates with Doris through the HTTP protocol.

    The HOST:PORT involved in this method should be the HTTP protocol port.

    • BE’s HTTP protocol port, the default is 8040.

    In this document, we use the curl command as an example to demonstrate how to import data.

    At the end of the document, we give a code example of importing data using Java

    1. Create a table

      Use the command to create a table in the to store the data to be imported. For the specific import method, please refer to the CREATE TABLE command manual. An example is as follows:

    2. Import data

      Execute the following curl command to import the local file:

      • user:passwd is the user created in Doris. The initial user is admin/root, and the password is blank in the initial state.
      • host:port is the HTTP protocol port of BE, the default is 8040, which can be viewed on the Doris cluster WEB UI page.
    3. Wait for the import result

      The Stream Load command is a synchronous command, and a successful return indicates that the import is successful. If the imported data is large, a longer waiting time may be required. Examples are as follows:

      • The status of the field is , which means the import is successful.
      • For details of other fields, please refer to the command documentation.
    • Stream Load can only import local files.

    Here is a simple JAVA example to execute Stream Load: