wuwenchi commented on code in PR #4865:
URL: https://github.com/apache/iceberg/pull/4865#discussion_r885143325
##########
docs/flink/flink-getting-started.md:
##########
@@ -547,6 +547,71 @@ RewriteDataFilesActionResult result =
Actions.forTable(table)
For more doc about options of the rewrite files action, please see
[RewriteDataFilesAction](../../../javadoc/{{% icebergVersion
%}}/org/apache/iceberg/flink/actions/RewriteDataFilesAction.html)
+## Type compatibility
+
+Iceberg's type system is mapped to Flink's type system. This type conversion
can be done by Iceberg automatically, though the following cases need to be
considered.
+See the notes section below for compatibility concerns and how to overcome
them.
+
+### Flink type to Iceberg type
+
+This type conversion table describes how Flink types are converted to the
Iceberg types. The conversion applies on both creating Iceberg table and
writing to Iceberg table via Flink.
+
+| Flink | Iceberg | Notes |
+|----------------- |----------------------------|---------------|
+| boolean | boolean | |
+| tinyint | integer | |
+| smallint | integer | |
+| integer | integer | |
+| bigint | long | |
+| float | float | |
+| double | double | |
+| char | string | |
+| varchar | string | |
+| string | string | |
+| binary | binary | |
+| varbinary | fixed | |
+| decimal | decimal | |
+| date | date | |
+| time | time | |
+| timestamp | timestamp without timezone | |
+| timestamp_ltz | timestamp with timezone | |
+| array | list | |
+| map | map | |
+| multiset | map | |
+| row | struct | |
+| raw | | Not supported |
+| interval | | Not supported |
+| structured | | Not supported |
+| timestamp with zone | | Not supported |
+| distinct | | Not supported |
+| null | | Not supported |
+| symbol | | Not supported |
+| logical | | Not supported |
+
+### Iceberg type to Flink type
+
+This type conversion table describes how Iceberg types are converted to the
Flink types. The conversion applies on reading from Iceberg table via Flink.
+
+| Iceberg | Flink | Notes
|
+|----------------------------|---------------|--------------------------------------------------|
+| boolean | boolean |
|
+| struct | row |
|
+| list | array |
|
+| map | map |
|
+| integer | integer |
|
+| long | bigint |
|
+| float | float |
|
+| double | double |
|
+| date | date |
|
+| time | time | precision is fixed at 0
|
Review Comment:
done
##########
docs/flink/flink-getting-started.md:
##########
@@ -547,6 +547,70 @@ RewriteDataFilesActionResult result =
Actions.forTable(table)
For more doc about options of the rewrite files action, please see
[RewriteDataFilesAction](../../../javadoc/{{% icebergVersion
%}}/org/apache/iceberg/flink/actions/RewriteDataFilesAction.html)
+## Type conversion
+
+Iceberg's integration for Flink automatically converts between Flink and
Iceberg types. When writing to a table with types that are not supported by
Flink, like UUID, Iceberg will accept and convert values from the Flink type.
+
+### Flink to Iceberg
+
+Flink types are converted to Iceberg types according to the following table:
+
+| Flink | Iceberg | Notes |
+|----------------- |----------------------------|---------------|
+| boolean | boolean | |
+| tinyint | integer | |
+| smallint | integer | |
+| integer | integer | |
+| bigint | long | |
+| float | float | |
+| double | double | |
+| char | string | |
+| varchar | string | |
+| string | string | |
+| binary | binary | |
+| varbinary | fixed | |
+| decimal | decimal | |
+| date | date | |
+| time | time | |
+| timestamp | timestamp without timezone | |
+| timestamp_ltz | timestamp with timezone | |
+| array | list | |
+| map | map | |
+| multiset | map | |
+| row | struct | |
+| raw | | Not supported |
+| interval | | Not supported |
+| structured | | Not supported |
+| timestamp with zone | | Not supported |
+| distinct | | Not supported |
+| null | | Not supported |
+| symbol | | Not supported |
+| logical | | Not supported |
+
+### Iceberg type to Flink type
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]