Inserting data appends new records and data files to your Apache Iceberg table.
Write operations remain restricted to the specific engine (such as Spark or Trino) that originally created the table to ensure metadata consistency across the Lakehouse runtime catalog.
Before you begin
See the table overview to understand the different types of tables and the implications of using them.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the BigLake API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.
Required roles
To get the permissions that you need to insert data into a table, ask your administrator to grant you the following IAM roles on your project and storage bucket:
-
Write table data in credential vending mode:
BigLake Editor (
roles/biglake.editor) - the project -
Write table data in non-credential vending mode:
- BigLake Editor (
roles/biglake.editor) - the project - Storage Object User (
roles/storage.objectUser) - the Cloud Storage bucket
- BigLake Editor (
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Insert data into the table
Insert sample data into the table:
Spark
spark.sql("INSERT INTO TABLE_NAME VALUES (1, \"first row\"), (2, \"second row\"), (3, \"third row\");")
Trino
INSERT INTO TABLE_NAME VALUES (1, 'first row'), (2, 'second row'), (3, 'third row');
What's next
- Learn how to query a table.