# ColumnStore LOAD DATA INFILE

## Overview

The `LOAD DATA INFILE` statement reads rows from a text file into a table at a very high speed. The file name must be given as a literal string.

```sql
LOAD DATA [LOCAL] INFILE 'file_name' 
  INTO TABLE tbl_name
  [CHARACTER SET charset_name]
  [{FIELDS | COLUMNS}
    [TERMINATED BY 'string']
    [[OPTIONALLY] ENCLOSED BY 'char']
    [ESCAPED BY 'char']
  ]
  [LINES
    [STARTING BY 'string']
    [TERMINATED BY 'string']
]
```

* ColumnStore ignores the `ON DUPLICATE KEY` clause.
* Non-transactional `LOAD DATA INFILE` is directed to ColumnStores cpimport tool by default, which significantly increases performance.
* Transactional `LOAD DATA INFILE` statements (that is, with `AUTOCOMMIT` off or after a `START TRANSACTION`) are processed through normal DML processes.
* Use cpimport for importing `UTF-8` data that contains multi-byte values

The following example loads data into a simple 5- column table: A file named `/simpletable.tbl`*`has` the following data in it.*

```sql
1|100|1000|10000|Test Number 1|
2|200|2000|20000|Test Number 2|
3|300|3000|30000|Test Number 3|
```

The data can then be loaded into the simpletable table with the following syntax:

```sql
LOAD DATA INFILE 'simpletable.tbl' INTO TABLE simpletable FIELDS TERMINATED BY '|'
```

If the default mode is set to use cpimport internally, any output error files will be written to `/var/log/mariadb/columnstore/cpimport/` directory. It can be consulted for troubleshooting any errors reported.

## See Also

[LOAD DATA INFILE](/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/load-data-into-tables-or-index/load-data-infile.md)

<sub>*This page is: Copyright © 2025 MariaDB. All rights reserved.*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/analytics/mariadb-columnstore/reference/data-manipulation-statements/columnstore-load-data-infile.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
