--- id: reference title: SQL-based ingestion reference sidebar_label: Reference --- > This page describes SQL-based batch ingestion using the [`druid-multi-stage-query`](../multi-stage-query/index.md) > extension, new in Druid 24.0. Refer to the [ingestion methods](../ingestion/index.md#batch) table to determine which > ingestion method is right for you. ## SQL reference This topic is a reference guide for the multi-stage query architecture in Apache Druid. For examples of real-world usage, refer to the [Examples](examples.md) page. ### EXTERN Use the EXTERN function to read external data. Function format: ```sql SELECT FROM TABLE( EXTERN( '', '', '' ) ) ``` EXTERN consists of the following parts: 1. Any [Druid input source](../ingestion/native-batch-input-source.md) as a JSON-encoded string. 2. Any [Druid input format](../ingestion/data-formats.md) as a JSON-encoded string. 3. A row signature, as a JSON-encoded array of column descriptors. Each column descriptor must have a `name` and a `type`. The type can be `string`, `long`, `double`, or `float`. This row signature is used to map the external data into the SQL layer. For more information, see [Read external data with EXTERN](concepts.md#extern). ### INSERT Use the INSERT statement to insert data. Unlike standard SQL, INSERT loads data into the target table according to column name, not positionally. If necessary, use `AS` in your SELECT column list to assign the correct names. Do not rely on their positions within the SELECT clause. Statement format: ```sql INSERT INTO < SELECT query > PARTITIONED BY