{"record":{"id":"13f8dfb02f6c0393","repo":"apache/beam","slug":"unknown-logical-type","errorCode":null,"errorMessage":"Unknown logical type ","messagePattern":"Unknown logical type ","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":1066,"sourceCode":"        return convertAvroArray(beamFieldType, avroValue, options);\n      case LOGICAL_TYPE:\n        LogicalType<?, ?> logicalType =\n            Preconditions.checkArgumentNotNull(beamFieldType.getLogicalType());\n        String identifier = logicalType.getIdentifier();\n        if (SqlTypes.DATE.getIdentifier().equals(identifier)) {\n          return convertAvroDate(avroValue);\n        } else if (SqlTypes.TIME.getIdentifier().equals(identifier)) {\n          return convertAvroTime(avroValue);\n        } else if (SqlTypes.DATETIME.getIdentifier().equals(identifier)) {\n          return convertAvroDateTime(avroValue);\n        } else if (SQL_DATE_TIME_TYPES.contains(identifier)) {\n          switch (options.getTruncateTimestamps()) {\n            case TRUNCATE:\n              return truncateToMillis(avroValue);\n            case REJECT:\n              return safeToMillis(avroValue);\n            default:\n              throw new IllegalArgumentException(\n                  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:","sourceCodeStart":1048,"sourceCodeEnd":1084,"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#L1048-L1084","documentation":"Same 'Unknown timestamp truncation option: %s' IllegalArgumentException as the DATETIME case, but thrown at BigQueryUtils.java:1066 for LOGICAL_TYPE fields whose identifier is in SQL_DATE_TIME_TYPES (e.g. SqlTimeWithLocalTzType). It means the truncation option passed into convertAvroFormat was neither TRUNCATE nor REJECT. Internal guard against an invalid enum value.","triggerScenarios":"Reading BigQuery data containing a SQL date-time logical type (e.g. SqlTimeWithLocalTzType) via the Avro path while ConversionOptions.getTruncateTimestamps() holds an unknown value (not TRUNCATE/REJECT).","commonSituations":"Version-skew between Beam SDKs producing/consuming the enum; custom ConversionOptions instances; forked BigQueryIO code with an extended enum.","solutions":["Pass BigQueryIO.withTruncatedTimestamps() or keep the default REJECT mode; never feed custom values into ConversionOptions.","Align Beam SDK versions across all pipeline components.","Rebuild/redeploy the pipeline with one consistent Beam release.","In forked code, validate the enum before calling convertAvroFormat."],"exampleFix":"// before\nnew ConversionOptions(myCustomMode) // unknown enum constant\n// after\nBigQueryIO.readTableRows().withTruncatedTimestamps() // TRUNCATE (or omit for REJECT)","handlingStrategy":"validation","validationCode":"// Java: assert supported option before running a pipeline over SQL date-time logical types\nswitch (opts.getTruncateTimestamps()) {\n  case TRUNCATE:\n  case REJECT:\n    break;\n  default:\n    throw new IllegalArgumentException(\"Unsupported truncateTimestamps: \" + opts.getTruncateTimestamps());\n}","typeGuard":null,"tryCatchPattern":"try { convert(...) } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"Unknown timestamp truncation option\")) { opts = ConversionOptions.truncateTimestamps(); convert(...); } else throw e; }","preventionTips":["Use only the two supported enum values (default REJECT, or withTruncatedTimestamps).","Keep Beam SDK versions consistent across producer and consumer components."],"tags":["java","beam","bigquery","avro","enum","logical-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-14T16:17:12.679Z"}