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 18:22:40 UTC
[GitHub] [iceberg] grantatspothero commented on a change in pull request #1848: Add support for converting avro schemas containing timestamps without the adjust-to-utc annotations
grantatspothero commented on a change in pull request #1848:
URL: https://github.com/apache/iceberg/pull/1848#discussion_r532805813
##########
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
+ return false;
Review comment:
The instanceof check is on the *logical type* not the object prop. So the instanceof check will pass and then the object prop will be null and hit this branch.
----------------------------------------------------------------
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