{"record":{"id":"4aa97d3adb815870","repo":"apache/beam","slug":"converting-bigquery-type-s-to-beam-type-is-unsupported","errorCode":null,"errorMessage":"Converting BigQuery type %s to Beam type is unsupported","messagePattern":"Converting BigQuery type (.+?) to Beam type is unsupported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java","lineNumber":1378,"sourceCode":"          if (!typeAlreadyExists) {\n            descriptorBuilder.addNestedType(TIMESTAMP_PICOS_DESCRIPTOR_PROTO);\n          }\n          fieldDescriptorBuilder =\n              fieldDescriptorBuilder\n                  .setType(FieldDescriptorProto.Type.TYPE_MESSAGE)\n                  .setTypeName(TIMESTAMP_PICOS_DESCRIPTOR_PROTO.getName());\n        } else {\n          // Microsecond precision - use simple INT64\n          fieldDescriptorBuilder =\n              fieldDescriptorBuilder.setType(FieldDescriptorProto.Type.TYPE_INT64);\n        }\n        break;\n\n      default:\n        FieldDescriptorProto.@Nullable Type type =\n            PRIMITIVE_TYPES_BQ_TO_PROTO.get(fieldSchema.getType());\n        if (type == null) {\n          throw new UnsupportedOperationException(\n              \"Converting BigQuery type \" + fieldSchema.getType() + \" to Beam type is unsupported\");\n        }\n        fieldDescriptorBuilder = fieldDescriptorBuilder.setType(type);\n    }\n\n    if (fieldSchema.getMode() == TableFieldSchema.Mode.REPEATED) {\n      fieldDescriptorBuilder = fieldDescriptorBuilder.setLabel(Label.LABEL_REPEATED);\n    } else if (!respectRequired || fieldSchema.getMode() != TableFieldSchema.Mode.REQUIRED) {\n      fieldDescriptorBuilder = fieldDescriptorBuilder.setLabel(Label.LABEL_OPTIONAL);\n    } else {\n      fieldDescriptorBuilder = fieldDescriptorBuilder.setLabel(Label.LABEL_REQUIRED);\n    }\n    descriptorBuilder.addField(fieldDescriptorBuilder.build());\n  }\n\n  /**\n   * mergeNewFields(original, newFields) unlike proto merge or concatenating proto bytes is merging\n   * the main differences is skipping primitive fields that are already set and merging structs and","sourceCodeStart":1360,"sourceCodeEnd":1396,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java#L1360-L1396","documentation":"When building a protobuf FieldDescriptorProto from a BigQuery TableFieldSchema, BigQuery types with no corresponding proto primitive type in PRIMITIVE_TYPES_BQ_TO_PROTO are rejected with an UnsupportedOperationException. It means the table declares a BigQuery type this converter cannot map (e.g. GEOGRAPHY, JSON, INTERVAL, RANGE depending on Beam version).","triggerScenarios":"Writing to or reading from a BigQuery table whose schema contains newer BQ types (GEOGRAPHY, JSON, INTERVAL/RANGE) through the Storage Write/Avro-unsupported path that uses proto conversion.","commonSituations":"Target table created with JSON or GEOGRAPHY columns while the pipeline schema still declares them; BigQuery adding new types not yet mapped in the installed Beam version.","solutions":["Remove or cast the unsupported column (e.g. store JSON as STRING, GEOGRAPHY as STRING/WKT).","Upgrade Apache Beam — newer versions map more BigQuery types.","Exclude unsupported fields via select()/projection before writing.","Use a different sink path (e.g. FILE_LOADS) that supports the type."],"exampleFix":"// before\nschema field of type GEOGRAPHY fed to proto conversion\n// after\nschema field of type STRING holding WKT: SELECT ST_AsText(geo) AS geo","handlingStrategy":"validation","validationCode":"Set<String> SUPPORTED = Set.of(\"BOOL\",\"INT64\",\"FLOAT64\",\"NUMERIC\",\"STRING\",\"BYTES\",\"TIMESTAMP\",\"DATE\",\"TIME\",\"DATETIME\"); List<String> unsupported = schema.getFieldsList().stream().map(TableFieldSchema::getType).filter(t -> !SUPPORTED.contains(t.name())).map(Enum::name).toList();","typeGuard":"boolean bqTypeSupported(TableFieldSchema.Type t) { return PRIMITIVE_TYPES_BQ_TO_PROTO.containsKey(t); }","tryCatchPattern":"try { protoFieldFor(schemaField); } catch (UnsupportedOperationException e) { LOG.warn(\"Skipping unsupported BQ type {}\", schemaField.getType()); }","preventionTips":["Inspect the target table schema for GEOGRAPHY/JSON/INTERVAL/RANGE before using Storage API writes","Cast exotic types to STRING upstream","Upgrade Beam when new BigQuery types ship","Use FILE_LOADS sink for tables with unsupported column types"],"tags":["bigquery","unsupported-type","schema","java"],"backgroundTag":"unsupported-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}