Import CSV

The Import CSV functionality in the Web Console provides a user-friendly interface to upload and import CSV files into QuestDB. You can create new tables or append data to existing tables with automatic schema detection and flexible configuration options.

Import CSV interface in the Web Console

Accessing the Import Interface​

You can access the import tab by clicking the import icon in the left-side navigation menu of the Web Console.

Screenshot of the Web Console showing the location of the Import tab

Import Process​

Upload Queue​

Once a file is added to the upload queue, the following configurations will be displayed:

Screenshot of the Web Console showing the file ready to be uploaded

Configuration Options​

  • File: The file name, size, and import status
  • Table name: The name of the table to be created or updated. By default, this is the name of the imported file
  • Schema: The column name and data type. The schema is automatically detected but can be set manually
  • Write mode:
    • Append: Uploaded data will be appended to the end of the table
    • Overwrite: Uploaded data will override existing data in the table
  • Actions:
    • Settings: Additional configuration for the import
    • Upload: Start the upload
    • X: Delete the file from the upload queue

Table Schema Configuration​

For Existing Tables​

To update the schema of an existing table, select Overwrite write mode to replace the existing rows and partition unit with data from the CSV file.

For an existing table, changing the table name allows you to import the data as a new separate table.

For New Tables​

The following settings are available for configuration:

SettingDescription
PartitionChange the partition setting of the table
Designated timestampSelecting a designated timestamp. This is mandatory if the partition unit is not NONE
Data typeDefine the data type. For timestamp, the timestamp format is mandatory and there is the option to select the column as the designated timestamp
Delete columnClick x to delete the column from the table
Add columnAt the end of the column list, select "Add column" to insert a new column into the table

The following table schema details are imported based on the CSV file:

  • The column order
  • The column name

Import Settings​

The Settings panel displays the following configurations:

SettingDescriptionDefault value
Maximum number of uncommitted rowsThe size of the commit batch. A commit will be issued when this number is reached in the buffer. This setting is the same as cairo.max.uncommitted.rows. To avoid running out of memory during an import, set this value based on the RAM size of the machine500000
DelimiterThe delimiter character to parse the CSV fileAutomatic
AtomicityError behavior. Rejected rows or columns will be reported in the Details panel after the import is completedSkip column
Force headerWhether to interpret the first line as the header. The result will be reported in the Details panel after the import is completedFALSE
Skip line extra valuesWhether the parser should ignore extra values by skipping the entire line. An extra value is something in addition to what is defined by the headerFALSE

Import Results and Details​

Status Display​

The import status is displayed in the file column. Once the action is completed, the number of rows inserted is displayed alongside the Details tab:

Screenshot of the Web Console showing number of row imported and the Details tab

Details Panel​

The Details panel lists rejected rows and import errors for each column:

Screenshot of the Web Console showing the import details

The details such as forced header, table name, and rejected rows are related to the import settings you defined. For example, setting Atomicity in Settings to "Skip row" will result in skipped rows being reported under Rejected rows after the import.