You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add Iceberg table write support documentation (databend#19200) (#3079)
Document the new INSERT INTO support for Iceberg tables, including
CREATE TABLE with ENGINE=ICEBERG, PARTITION BY, supported data types,
and examples for non-partitioned, single-field, and multi-field
partitioned tables.
import FunctionDescription from '@site/src/components/FunctionDescription';
9
9
10
-
<FunctionDescriptiondescription="Introduced or updated: v1.2.668"/>
10
+
<FunctionDescriptiondescription="Introduced or updated: v1.2.725"/>
11
11
12
12
Databend supports the integration of an [Apache Iceberg™](https://iceberg.apache.org/) catalog, enhancing its compatibility and versatility for data management and analytics. This extends Databend's capabilities by seamlessly incorporating the powerful metadata and storage management capabilities of Apache Iceberg™ into the platform.
In addition to metadata caching, Databend also supports table data caching for Iceberg catalog tables, similar to Fuse tables. For more information on data caching, refer to the [cache section](/guides/self-hosted/references/node-config/query-config#cache-section) in the Query Configurations reference.
418
418
419
+
## Writing to Iceberg Tables
420
+
421
+
Databend supports writing data to Iceberg tables using `INSERT INTO`. You can create Iceberg tables directly with the `ENGINE = ICEBERG` clause and optionally define partition columns using `PARTITION BY`.
422
+
423
+
### Creating Iceberg Tables
424
+
425
+
#### Syntax
426
+
427
+
```sql
428
+
CREATE TABLE <table_name> (
429
+
<column_definitions>
430
+
) ENGINE = ICEBERG
431
+
[PARTITION BY (<column1>[, <column2>, ...])];
432
+
```
433
+
434
+
-`ENGINE = ICEBERG`: Specifies that the table is stored in Iceberg format.
435
+
-`PARTITION BY`: Optional. Defines one or more columns for partitioning the table data.
436
+
437
+
#### Supported Data Types
438
+
439
+
The following Databend data types are supported for writing to Iceberg tables:
440
+
441
+
| Databend Type | Iceberg Type |
442
+
|---------------|-------------|
443
+
| BOOLEAN | Boolean |
444
+
| INT | Int |
445
+
| BIGINT | Long |
446
+
| FLOAT | Float |
447
+
| DOUBLE | Double |
448
+
| STRING | String |
449
+
| DATE | Date |
450
+
| TIMESTAMP | Timestamp |
451
+
452
+
### Inserting Data
453
+
454
+
Use standard `INSERT INTO` statements to write data into Iceberg tables:
455
+
456
+
```sql
457
+
INSERT INTO<table_name>VALUES (...), (...);
458
+
```
459
+
460
+
Both partitioned and non-partitioned tables support single-row and multi-row inserts. For partitioned tables, Databend automatically routes rows to the correct partitions. Null values in partition columns are also supported.
461
+
462
+
### Examples
463
+
464
+
#### Non-Partitioned Table
465
+
466
+
```sql
467
+
CREATETABLEt_scores(id INT, name STRING, score DOUBLE) ENGINE = ICEBERG;
468
+
469
+
INSERT INTO t_scores VALUES (1, 'alice', 85.5);
470
+
INSERT INTO t_scores VALUES (2, 'bob', 90.0), (3, 'charlie', 75.5);
0 commit comments