You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/05/29 21:04:41 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #4865: Docs: add flink and iceberg type compatibility

rdblue commented on code in PR #4865:
URL: https://github.com/apache/iceberg/pull/4865#discussion_r884324152


##########
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:
   precision is 0? I would expect that to be 6 for microseconds.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org