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/11/30 17:20:24 UTC
[GitHub] [iceberg] rdblue commented on a change in pull request #1848: Add support for converting avro schemas containing timestamps without the adjust-to-utc annotations
rdblue commented on a change in pull request #1848:
URL: https://github.com/apache/iceberg/pull/1848#discussion_r532765677
##########
File path: core/src/main/java/org/apache/iceberg/avro/AvroSchemaUtil.java
##########
@@ -107,10 +107,14 @@ public static Schema buildAvroProjection(Schema schema, org.apache.iceberg.Schem
public static boolean isTimestamptz(Schema schema) {
LogicalType logicalType = schema.getLogicalType();
- if (logicalType != null && logicalType instanceof LogicalTypes.TimestampMicros) {
+ if (logicalType instanceof LogicalTypes.TimestampMillis || logicalType instanceof LogicalTypes.TimestampMicros) {
// timestamptz is adjusted to UTC
Object value = schema.getObjectProp(ADJUST_TO_UTC_PROP);
- if (value instanceof Boolean) {
+
+ if (value == null) {
+ // not all avro timestamp logical types will have the adjust_to_utc prop, default to not timestamptz
Review comment:
How about "default to timestamp" or "default to timestamp without time zone"?
----------------------------------------------------------------
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