Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/docs/flink-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ title: "Flink Actions"
- limitations under the License.
-->

## Rewrite files action.
## Rewrite files action

Iceberg provides API to rewrite small files into large files by submitting Flink batch jobs. The behavior of this Flink action is the same as Spark's [rewriteDataFiles](maintenance.md#compact-data-files).
Iceberg provides API to rewrite small files into large files by submitting Flink batch jobs. The behavior of this Flink action is the same as Spark's [rewriteDataFiles](../maintenance.md#compact-data-files).

```java
import org.apache.iceberg.flink.actions.Actions;
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/flink-connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ To create the table in Flink SQL by using SQL syntax `CREATE TABLE test (..) WIT
* `connector`: Use the constant `iceberg`.
* `catalog-name`: User-specified catalog name. It's required because the connector don't have any default value.
* `catalog-type`: `hive` or `hadoop` for built-in catalogs (defaults to `hive`), or left unset for custom catalog implementations using `catalog-impl`.
* `catalog-impl`: The fully-qualified class name of a custom catalog implementation. Must be set if `catalog-type` is unset. See also [custom catalog](flink.md#adding-catalogs) for more details.
* `catalog-impl`: The fully-qualified class name of a custom catalog implementation. Must be set if `catalog-type` is unset. See also [custom catalog](../flink.md#adding-catalogs) for more details.
* `catalog-database`: The iceberg database name in the backend catalog, use the current flink database name by default.
* `catalog-table`: The iceberg table name in the backend catalog. Default to use the table name in the flink `CREATE TABLE` sentence.

## Table managed in Hive catalog.

Before executing the following SQL, please make sure you've configured the Flink SQL client correctly according to the [quick start documentation](flink.md).
Before executing the following SQL, please make sure you've configured the Flink SQL client correctly according to the [quick start documentation](../flink.md).

The following SQL will create a Flink table in the current Flink catalog, which maps to the iceberg table `default_database.flink_table` managed in iceberg catalog.

Expand Down Expand Up @@ -138,4 +138,4 @@ SELECT * FROM flink_table;
3 rows in set
```

For more details, please refer to the Iceberg [Flink documentation](flink.md).
For more details, please refer to the Iceberg [Flink documentation](../flink.md).
2 changes: 1 addition & 1 deletion docs/docs/flink-ddl.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Table create commands support the commonly used [Flink create clauses](https://n

* `PARTITION BY (column1, column2, ...)` to configure partitioning, Flink does not yet support hidden partitioning.
* `COMMENT 'table document'` to set a table description.
* `WITH ('key'='value', ...)` to set [table configuration](configuration.md) which will be stored in Iceberg table properties.
* `WITH ('key'='value', ...)` to set [table configuration](../configuration.md) which will be stored in Iceberg table properties.

Currently, it does not support computed column and watermark definition etc.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/flink-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ SET table.exec.iceberg.use-flip27-source = true;

### Reading branches and tags with SQL
Branch and tags can be read via SQL by specifying options. For more details
refer to [Flink Configuration](flink-configuration.md#read-options)
refer to [Flink Configuration](../flink-configuration.md#read-options)

```sql
--- Read from branch b1
Expand Down
30 changes: 15 additions & 15 deletions docs/docs/flink-writes.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,20 @@ Iceberg supports `UPSERT` based on the primary key when writing data into v2 tab

1. Enable the `UPSERT` mode as table-level property `write.upsert.enabled`. Here is an example SQL statement to set the table property when creating a table. It would be applied for all write paths to this table (batch or streaming) unless overwritten by write options as described later.

```sql
CREATE TABLE `hive_catalog`.`default`.`sample` (
`id` INT COMMENT 'unique id',
`data` STRING NOT NULL,
PRIMARY KEY(`id`) NOT ENFORCED
) with ('format-version'='2', 'write.upsert.enabled'='true');
```
```sql
CREATE TABLE `hive_catalog`.`default`.`sample` (
`id` INT COMMENT 'unique id',
`data` STRING NOT NULL,
PRIMARY KEY(`id`) NOT ENFORCED
) with ('format-version'='2', 'write.upsert.enabled'='true');
```

2. Enabling `UPSERT` mode using `upsert-enabled` in the [write options](#write-options) provides more flexibility than a table level config. Note that you still need to use v2 table format and specify the primary key when creating the table.
2. Enabling `UPSERT` mode using `upsert-enabled` in the [write options](#write-options) provides more flexibility than a table level config. Note that you still need to use v2 table format and specify the [primary key](../flink-ddl.md/#primary-key) or [identifier fields](../../spec.md#identifier-field-ids) when creating the table.

```sql
INSERT INTO tableName /*+ OPTIONS('upsert-enabled'='true') */
...
```
```sql
INSERT INTO tableName /*+ OPTIONS('upsert-enabled'='true') */
...
```

!!! info
OVERWRITE and UPSERT can't be set together. In UPSERT mode, if the table is partitioned, the partition fields should be included in equality fields.
Expand All @@ -85,7 +85,7 @@ INSERT INTO tableName /*+ OPTIONS('upsert-enabled'='true') */
Iceberg support writing to iceberg table from different DataStream input.


### Appending data.
### Appending data

Flink supports writing `DataStream<RowData>` and `DataStream<Row>` to the sink iceberg table natively.

Expand Down Expand Up @@ -185,7 +185,7 @@ FlinkSink.builderFor(

### Branch Writes
Writing to branches in Iceberg tables is also supported via the `toBranch` API in `FlinkSink`
For more information on branches please refer to [branches](branching.md).
For more information on branches please refer to [branches](../branching.md).
```java
FlinkSink.forRowData(input)
.tableLoader(tableLoader)
Expand Down Expand Up @@ -262,7 +262,7 @@ INSERT INTO tableName /*+ OPTIONS('upsert-enabled'='true') */
...
```

Check out all the options here: [write-options](flink-configuration.md#write-options)
Check out all the options here: [write-options](../flink-configuration.md#write-options)

## Notes

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/flink.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ env.execute("Test Iceberg DataStream");

### Branch Writes
Writing to branches in Iceberg tables is also supported via the `toBranch` API in `FlinkSink`
For more information on branches please refer to [branches](branching.md).
For more information on branches please refer to [branches](../branching.md).
```java
FlinkSink.forRowData(input)
.tableLoader(tableLoader)
Expand Down