{"record":{"id":"5b0d05713d68aa66","repo":"apache/iceberg","slug":"unsupported-zonedtimestamptype-5b0d05","errorCode":null,"errorMessage":"Unsupported ZonedTimestampType.","messagePattern":"Unsupported ZonedTimestampType\\.","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java","lineNumber":38,"sourceCode":"\nimport org.apache.flink.table.types.logical.DayTimeIntervalType;\nimport org.apache.flink.table.types.logical.DistinctType;\nimport org.apache.flink.table.types.logical.LogicalType;\nimport org.apache.flink.table.types.logical.LogicalTypeVisitor;\nimport org.apache.flink.table.types.logical.NullType;\nimport org.apache.flink.table.types.logical.RawType;\nimport org.apache.flink.table.types.logical.StructuredType;\nimport org.apache.flink.table.types.logical.SymbolType;\nimport org.apache.flink.table.types.logical.YearMonthIntervalType;\nimport org.apache.flink.table.types.logical.ZonedTimestampType;\n\npublic abstract class FlinkTypeVisitor<T> implements LogicalTypeVisitor<T> {\n\n  // ------------------------- Unsupported types ------------------------------\n\n  @Override\n  public T visit(ZonedTimestampType zonedTimestampType) {\n    throw new UnsupportedOperationException(\"Unsupported ZonedTimestampType.\");\n  }\n\n  @Override\n  public T visit(YearMonthIntervalType yearMonthIntervalType) {\n    throw new UnsupportedOperationException(\"Unsupported YearMonthIntervalType.\");\n  }\n\n  @Override\n  public T visit(DayTimeIntervalType dayTimeIntervalType) {\n    throw new UnsupportedOperationException(\"Unsupported DayTimeIntervalType.\");\n  }\n\n  @Override\n  public T visit(DistinctType distinctType) {\n    throw new UnsupportedOperationException(\"Unsupported DistinctType.\");\n  }\n\n  @Override","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java#L20-L56","documentation":"FlinkTypeVisitor is an abstract LogicalTypeVisitor that throws UnsupportedOperationException for every Flink logical type Iceberg cannot map. ZonedTimestampType (TIMESTAMP WITH LOCAL TIME ZONE / zoned timestamps) has no Iceberg representation, so the default visit throws immediately.","triggerScenarios":"Any FlinkSchemaUtil/FlinkTypeUtil conversion that accepts a column of Flink type TIMESTAMP(3) WITH LOCAL TIME ZONE (ZonedTimestampType), causing visitor dispatch to visit(ZonedTimestampType).","commonSituations":"Creating an Iceberg-backed Flink table with 'TIMESTAMP_LTZ(3)' columns; converting a Flink schema containing time-zone-aware timestamps to an Iceberg schema; users assuming TIMESTAMP_LTZ maps to Iceberg timestamptz.","solutions":["Use TIMESTAMP WITHOUT TIME ZONE (TimestampType) in the Flink schema instead of TIMESTAMP_LTZ.","Cast the column: CAST(ts_col AS TIMESTAMP(3)) before schema conversion.","Subclass FlinkTypeVisitor and override visit(ZonedTimestampType) to map to TimestampType.withZone() if your pipeline can handle it.","Store the value as a string or epoch-millis BIGINT column if zone info must be preserved."],"exampleFix":"// before\ncol 'event_ts' TIMESTAMP(3) WITH LOCAL TIME ZONE\n\n// after\ncol 'event_ts' TIMESTAMP(3)  -- without time zone","handlingStrategy":"validation","validationCode":"for (Column col : resolvedSchema.getColumns()) {\n  LogicalType t = col.getDataType().getLogicalType();\n  if (t instanceof ZonedTimestampType) {\n    throw new IllegalArgumentException(\n        \"Column '\" + col.getName() + \"' uses TIMESTAMP WITH LOCAL TIME ZONE; use TIMESTAMP instead\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  Schema s = FlinkSchemaUtil.toIcebergSchema(flinkSchema);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"ZonedTimestampType\")) {\n    // cast TIMESTAMP_LTZ columns to TIMESTAMP\n  } else {\n    throw e;\n  }\n}","preventionTips":["Use TIMESTAMP (without local time zone) in Iceberg-backed Flink tables.","Scan DDLs for TIMESTAMP_LTZ / WITH LOCAL TIME ZONE before schema conversion.","Centralize schema conversion behind a helper that pre-validates types."],"tags":["flink","type-mapping","timestamp","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}