{"record":{"id":"768b0b7e4df22bc3","repo":"apache/beam","slug":"does-not-support-converting-unknown-type-value","errorCode":null,"errorMessage":"Does not support converting unknown type value: \" + beamFieldTypeName","messagePattern":"Does not support converting unknown type value: \" \\+ beamFieldTypeName","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java","lineNumber":1085,"sourceCode":"                  String.format(\n                      \"Unknown timestamp truncation option: %s\", options.getTruncateTimestamps()));\n          }\n        } else if (logicalType instanceof PassThroughLogicalType) {\n          return convertAvroFormat(logicalType.getBaseType(), avroValue, options);\n        } else {\n          throw new RuntimeException(\"Unknown logical type \" + identifier);\n        }\n      case ROW:\n        Schema rowSchema = beamFieldType.getRowSchema();\n        if (rowSchema == null) {\n          throw new IllegalArgumentException(\"Nested ROW missing row schema\");\n        }\n        GenericData.Record record = (GenericData.Record) avroValue;\n        return toBeamRow(record, rowSchema, options);\n      case MAP:\n        return convertAvroRecordToMap(beamFieldType, avroValue, options);\n      default:\n        throw new RuntimeException(\n            \"Does not support converting unknown type value: \" + beamFieldTypeName);\n    }\n  }\n\n  private static ReadableInstant safeToMillis(Object value) {\n    long subMilliPrecision = ((long) value) % 1000;\n    if (subMilliPrecision != 0) {\n      throw new IllegalArgumentException(\n          String.format(\n              \"BigQuery data contained value %s with sub-millisecond precision, which Beam does\"\n                  + \" not currently support.\"\n                  + \" You can enable truncating timestamps to millisecond precision\"\n                  + \" by using BigQueryIO.withTruncatedTimestamps\",\n              value));\n    } else {\n      return truncateToMillis(value);\n    }\n  }","sourceCodeStart":1067,"sourceCodeEnd":1103,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java#L1067-L1103","documentation":"Thrown as RuntimeException from the default branch of convertAvroFormat's TypeName switch when the Beam field's type name is none of the handled cases (BYTE/INT16/INT32/INT64/FLOAT/DOUBLE/STRING/BYTES/BOOLEAN/DATETIME/DECIMAL/ARRAY/LOGICAL_TYPE/ROW/MAP). The BigQuery Avro converter does not know how to decode an Avro value into that Beam type.","triggerScenarios":"Beam schema containing a TypeName not covered by the switch — typically from schema evolution/beam version skew introducing a new TypeName, or a malformed/custom schema fed to BigQueryIO.readTableRows' avro conversion path.","commonSituations":"Running older Beam against schemas produced by newer Beam (new TypeName constants); programmatically built schemas with exotic types; incorrect deserialization producing a garbage type name.","solutions":["Upgrade the Beam SDK so the switch covers the type name shown in the error.","Change the offending schema field to a supported type (primitive, ARRAY, ROW, MAP, DATETIME, DECIMAL, or known logical type).","Check for Beam version skew between the component that produced the schema and the one converting it.","If you control the fork, add the missing TypeName case to convertAvroFormat."],"exampleFix":"// before\nFieldType bad = FieldType.iterable(FieldType.INT32); // exotic container\n// after\nFieldType ok = FieldType.array(FieldType.INT32); // ARRAY handled by converter","handlingStrategy":"validation","validationCode":"// Java: whitelist supported TypeNames before conversion\nSet<TypeName> ok = EnumSet.of(TypeName.BYTE, TypeName.INT16, TypeName.INT32, TypeName.INT64,\n    TypeName.FLOAT, TypeName.DOUBLE, TypeName.STRING, TypeName.BYTES, TypeName.BOOLEAN,\n    TypeName.DATETIME, TypeName.DECIMAL, TypeName.ARRAY, TypeName.LOGICAL_TYPE,\n    TypeName.ROW, TypeName.MAP);\nschema.getFields().forEach(f -> {\n  if (!ok.contains(f.getType().getTypeName())) throw new IllegalStateException(\"Unsupported: \" + f.getType());\n});","typeGuard":"// Java\nstatic boolean isConvertibleTypeName(TypeName tn) {\n  return tn.isPrimitiveType() || tn == TypeName.ARRAY || tn == TypeName.ROW\n      || tn == TypeName.MAP || tn == TypeName.DATETIME || tn == TypeName.DECIMAL\n      || tn == TypeName.LOGICAL_TYPE;\n}","tryCatchPattern":"try { ... } catch (RuntimeException e) { if (e.getMessage().startsWith(\"Does not support converting unknown type value\")) { log.error(\"Field type {} unsupported; fix schema or upgrade Beam\", e.getMessage()); } throw e; }","preventionTips":["Keep Beam SDK versions aligned so new TypeNames are handled by the converter.","Stick to documented BigQueryIO-supported schema types when defining Beam schemas."],"tags":["java","beam","bigquery","avro","type-mismatch"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}