{"record":{"id":"8e7f9686eca396b9","repo":"apache/iceberg","slug":"not-supported-yet","errorCode":null,"errorMessage":"Not supported yet.","messagePattern":"Not supported yet\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/StructRowData.java","lineNumber":214,"sourceCode":"        LocalDateTime ldt = (LocalDateTime) timeVal;\n        return TimestampData.fromEpochMillis(\n            ldt.toInstant(ZoneOffset.UTC).toEpochMilli(), ldt.getNano() % 1_000_000);\n      } else if (timeVal instanceof Long) {\n        long timeLong = (Long) timeVal;\n        return TimestampData.fromEpochMillis(\n            Math.floorDiv(timeLong, 1_000_000L), (int) Math.floorMod(timeLong, 1_000_000L));\n      } else {\n        throw new IllegalStateException(\"Unknown type for timestamp_ns: \" + timeVal.getClass());\n      }\n    }\n    long timeLong = getLong(pos);\n    return TimestampData.fromEpochMillis(\n        Math.floorDiv(timeLong, 1000L), (int) Math.floorMod(timeLong, 1000L) * 1000);\n  }\n\n  @Override\n  public <T> RawValueData<T> getRawValue(int pos) {\n    throw new UnsupportedOperationException(\"Not supported yet.\");\n  }\n\n  @Override\n  public byte[] getBinary(int pos) {\n    return isNullAt(pos) ? null : getBinaryInternal(pos);\n  }\n\n  private byte[] getBinaryInternal(int pos) {\n    Object bytes = struct.get(pos, Object.class);\n\n    // should only be either ByteBuffer or byte[]\n    if (bytes instanceof ByteBuffer) {\n      return ByteBuffers.toByteArray((ByteBuffer) bytes);\n    } else if (bytes instanceof byte[]) {\n      return (byte[]) bytes;\n    } else if (bytes instanceof UUID) {\n      UUID uuid = (UUID) bytes;\n      ByteBuffer bb = ByteBuffer.allocate(16);","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/StructRowData.java#L196-L232","documentation":"StructRowData wraps an Iceberg StructLike as a Flink RowData. Its getRawValue method, which would return an opaque RawValueData view of a field, is simply not implemented and always throws UnsupportedOperationException. Callers must use the typed accessors (getInt, getLong, getBinary, etc.) instead.","triggerScenarios":"Calling RowData.getRawValue(pos) on a RowData produced by Iceberg's Flink data adapters (e.g. reading an Iceberg table's struct column as RowData), typically when a Flink codec/serializer or user function requests raw binary access to a field.","commonSituations":"Flink internal machinery or a UDF that optimizes by reading RawValueData from any RowData encounters a StructRowData; code that generically reads RowData fields assuming all implementations support raw access.","solutions":["Rewrite the calling code to use typed accessors (isNullAt, getInt, getLong, getRow, getArray, getMap, getBinary) on the StructRowData instead of getRawValue.","Convert the value via the Iceberg Flink converters (FlinkSchemaUtil / FlinkValueReaders path) to obtain a concrete typed value rather than raw bytes.","If raw access is genuinely required, materialize the struct into a GenericRowData (which supports getRawValue) before passing it to the code that calls getRawValue."],"exampleFix":"// before\nRawValueData<?> raw = rowData.getRawValue(pos);\n// after\nObject field = rowData.isNullAt(pos) ? null : convertTypedField(rowData, pos, fieldType); // use typed accessor per LogicalType","handlingStrategy":"type-guard","validationCode":"// before calling getRawValue\nif (rowData instanceof org.apache.iceberg.flink.data.StructRowData) {\n  throw new IllegalArgumentException(\"StructRowData does not support getRawValue; use typed accessors\");\n}","typeGuard":"boolean supportsRaw(RowData rd) { return !(rd instanceof org.apache.iceberg.flink.data.StructRowData); }","tryCatchPattern":"try { return rowData.getRawValue(pos); } catch (UnsupportedOperationException e) { return typedFallback(rowData, pos); }","preventionTips":["Use typed accessors (getInt/getLong/getBinary/getRow/getArray/getMap) when reading Iceberg RowData","Wrap Iceberg structs into GenericRowData if downstream code needs raw access","Document that getRawValue is unimplemented for Iceberg adapters in shared utility code"],"tags":["flink","rowdata","unsupported-operation"],"backgroundTag":"method-not-implemented","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}