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 2020/07/14 17:14:53 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #1174: Add TypeToFlinkType: convert iceberg types to Flink types

rdblue commented on a change in pull request #1174:
URL: https://github.com/apache/iceberg/pull/1174#discussion_r454513800



##########
File path: flink/src/main/java/org/apache/iceberg/flink/FlinkSchemaUtil.java
##########
@@ -21,10 +21,30 @@
 
 import org.apache.flink.table.api.TableSchema;
 import org.apache.flink.table.types.FieldsDataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.RowType;
+import org.apache.flink.table.types.utils.TypeConversions;
 import org.apache.iceberg.Schema;
 import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
 import org.apache.iceberg.types.Type;
+import org.apache.iceberg.types.TypeUtil;
 
+/**
+ * Converter between Flink types and Iceberg type.
+ * The conversion is not a 1:1 mapping that not allows back-and-forth conversion. So some information might get lost
+ * during the back-and-forth conversion.
+ * <p>
+ * This inconsistent types:
+ * <ul>
+ *   <li>map Iceberg UUID type to Flink BinaryType(16)</li>
+ *   <li>map Flink VarCharType and CharType to Iceberg String type (lost precision)</li>
+ *   <li>map Flink VarBinaryType to Iceberg Binary type (lost precision)</li>
+ *   <li>map Flink TimeType to Iceberg Time type (lost precision)</li>
+ *   <li>map Flink TimestampType to Iceberg Timestamp without zone type (lost precision)</li>
+ *   <li>map Flink LocalZonedTimestampType to Iceberg Timestamp with zone type (lost precision)</li>

Review comment:
       Precision isn't lost for date/time types. It is always 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.

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