{"record":{"id":"f805b08872b9eb76","repo":"apache/beam","slug":"unknown-bigquery-type-bqtype","errorCode":null,"errorMessage":"Unknown BigQuery type: \" + bqType","messagePattern":"Unknown BigQuery type: \" \\+ bqType","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryAvroUtils.java","lineNumber":160,"sourceCode":"        } else if (schema.getPrecision() != null) {\n          logicalType = LogicalTypes.decimal(schema.getPrecision().intValue());\n        } else if (bqType.equals(\"NUMERIC\")) {\n          logicalType = LogicalTypes.decimal(38, 9);\n        } else {\n          // BIGNUMERIC\n          logicalType = LogicalTypes.decimal(77, 38);\n        }\n        return logicalType.addToSchema(SchemaBuilder.builder().bytesType());\n      case \"GEOGRAPHY\":\n      case \"JSON\":\n        return SchemaBuilder.builder().stringBuilder().prop(\"sqlType\", bqType).endString();\n      case \"RECORD\":\n      case \"STRUCT\":\n        // record\n        throw new IllegalArgumentException(\"RECORD/STRUCT are not primitive types\");\n      case \"RANGE\": // TODO add support for range type\n      default:\n        throw new IllegalArgumentException(\"Unknown BigQuery type: \" + bqType);\n    }\n  }\n\n  /**\n   * Formats BigQuery seconds-since-epoch into String matching JSON export. Thread-safe and\n   * immutable.\n   */\n  private static final java.time.format.DateTimeFormatter DATE_TIME_FORMATTER =\n      java.time.format.DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss\")\n          .withZone(java.time.ZoneOffset.UTC);\n\n  /** Enum to define the precision of a timestamp since the epoch. */\n  enum TimestampPrecision {\n    MILLISECONDS,\n    MICROSECONDS,\n    NANOSECONDS;\n\n    /** Converts an epoch value of this precision to an Instant. */","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryAvroUtils.java#L142-L178","documentation":"getPrimitiveType throws IllegalArgumentException for BigQuery type names it does not recognize (including RANGE, currently unsupported). This guards against silently producing a wrong Avro primitive type when mapping BigQuery standard SQL types to Avro.","triggerScenarios":"convertField encounters a TableFieldSchema whose type is not in the supported set (STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP, DATE, TIME, DATETIME, NUMERIC, GEOGRAPHY, JSON, BYTES, etc.), e.g. RANGE or a newly added BigQuery type, when generating an Avro schema from a TableSchema.","commonSituations":"Newer BigQuery types (e.g. RANGE) or typo'd type names in a user-constructed TableSchema; pipelines exporting/reading with beam BigQueryIO and newer BigQuery features.","solutions":["Upgrade Apache Beam to a version supporting the type","Remove or transform the unsupported column (e.g. cast RANGE to STRING in SQL before the sink)","Fix the type string in the TableSchema if it was constructed manually"],"exampleFix":"// before\nTableFieldSchema f = new TableFieldSchema().setName(\"r\").setType(\"RANGE\");\n// after\nTableFieldSchema f = new TableFieldSchema().setName(\"r\").setType(\"STRING\"); // CAST in query first","handlingStrategy":"validation","validationCode":"Set<String> known = Set.of(\"STRING\",\"INTEGER\",\"FLOAT\",\"BOOLEAN\",\"TIMESTAMP\",\"DATE\",\"TIME\",\"DATETIME\",\"NUMERIC\",\"BIGNUMERIC\",\"BYTES\",\"GEOGRAPHY\",\"JSON\",\"INTERVAL\");\nif (!known.contains(field.getType())) throw new IllegalArgumentException(\"Unsupported BigQuery type \" + field.getType());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep Beam updated for new BigQuery types","CAST unsupported types in the SQL query before reading","Validate hand-built TableSchemas against known type strings"],"tags":["java","apache-beam","bigquery","avro","schema","unsupported-type"],"backgroundTag":"invalid-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}