Skip to main content
Version: 0.0.1

Inserting Data into Apache Iceberg Tables

The INSERT command inserts records into a table, either from values provided in the SQL command or from rows returned by a SELECT statement.

If the table does not exist or the schema does not match, the INSERT operation fails.

{{< codeheader "Syntax" >}}

INSERT INTO <table_path>.<table_name>
[ ( <column_name> [, <column_name> ...]) ]
{
select_statement
| VALUES (value [, value ...]) [, (value [, value ...]) ...]
}

Parameters

{{< sql-section file="data/sql/apache-iceberg-tables.json" data="insertingData" >}}

Example

{{< codeheader "Inserts three records" >}}

INSERT INTO myTable VALUES 
(21, 'Ruth Asawa', 'American, 1926–2013', 'American', 'Female', 1926, 2013, 'Q7382874', '500077806'),
(38, 'Magdalena Abakanowicz', 'Polish, 1930–2017', 'Polish', 'Female', 1930, 2017, 'Q158080', '500084577'),
(56, 'Luis Alberto Acuña', 'Colombian, 1904–1994', 'Colombian', 'Male', 1904, 1994, null, null)