{"record":{"id":"887990a95fda1419","repo":"apache/beam","slug":"could-not-use-the-provided-bigqueryservices-implementation","errorCode":null,"errorMessage":"Could not use the provided `BigQueryServices` implementation when upgrading.Using the default.","messagePattern":"Could not use the provided `BigQueryServices` implementation when upgrading\\.Using the default\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIOTranslation.java","lineNumber":290,"sourceCode":"        if (flattenResults != null) {\n          builder = builder.setFlattenResults(flattenResults);\n        }\n        Boolean useLegacySQL = configRow.getBoolean(\"use_legacy_sql\");\n        if (useLegacySQL != null) {\n          builder = builder.setUseLegacySql(useLegacySQL);\n        }\n        Boolean withTemplateCompatibility = configRow.getBoolean(\"with_template_compatibility\");\n        if (withTemplateCompatibility != null) {\n          builder = builder.setWithTemplateCompatibility(withTemplateCompatibility);\n        }\n        byte[] bigqueryServicesBytes = configRow.getBytes(\"bigquery_services\");\n        if (bigqueryServicesBytes != null) {\n          try {\n            builder =\n                builder.setBigQueryServices(\n                    (BigQueryServices) fromByteArray(bigqueryServicesBytes));\n          } catch (InvalidClassException e) {\n            LOG.warn(\n                \"Could not use the provided `BigQueryServices` implementation when upgrading.\"\n                    + \"Using the default.\");\n            builder.setBigQueryServices(new BigQueryServicesImpl());\n          }\n        }\n        byte[] parseFnBytes = configRow.getBytes(\"parse_fn\");\n        if (parseFnBytes != null) {\n          builder = builder.setParseFn((SerializableFunction) fromByteArray(parseFnBytes));\n        }\n        byte[] datumReaderFactoryBytes = configRow.getBytes(\"datum_reader_factory\");\n        if (datumReaderFactoryBytes != null) {\n          builder =\n              builder.setDatumReaderFactory(\n                  (SerializableFunction) fromByteArray(datumReaderFactoryBytes));\n        }\n        byte[] queryPriorityBytes = configRow.getBytes(\"query_priority\");\n        if (queryPriorityBytes != null) {\n          builder = builder.setQueryPriority((QueryPriority) fromByteArray(queryPriorityBytes));","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIOTranslation.java#L272-L308","documentation":"When Beam deserializes a persisted BigQueryIO write transform from its config Row (e.g. during pipeline translation or an SDK upgrade), it tries to restore a serialized custom BigQueryServices implementation. If deserialization throws InvalidClassException (class incompatible with the serialized version), Beam logs this warning and falls back to the default BigQueryServicesImpl.","triggerScenarios":"Reading a BigQueryIO write transform from a config Row (readTransformFromRow -> fromConfigRow) where 'bigquery_services' bytes were serialized by a different Beam/SDK version, producing an InvalidClassException during fromByteArray.","commonSituations":"Upgrading the Beam SDK between pipeline versions (e.g. updating runner images mid-pipeline); running an old serialized pipeline snapshot with a newer SDK; custom BigQueryServices class serialVersionUID changed between releases.","solutions":["Re-generate the pipeline with the current SDK version instead of replaying old serialized config rows.","Implement the custom BigQueryServices with a fixed serialVersionUID matching the serialized version, or ensure class compatibility across versions.","Accept the fallback if default BigQueryServicesImpl behavior is acceptable — this is only a warning.","Remove the custom setBigQueryServices if the default implementation suffices, avoiding the serialized class entirely."],"exampleFix":"// before\npublic class MyBqServices implements BigQueryServices { /* no serialVersionUID */ }\n// after\npublic class MyBqServices implements BigQueryServices {\n  private static final long serialVersionUID = 1L;\n}","handlingStrategy":"fallback","validationCode":"// Before relying on persisted custom services, verify deserializability:\ntry { fromByteArray(bigqueryServicesBytes); } catch (InvalidClassException e) { /* plan fallback */ }","typeGuard":"boolean isDeserializable(byte[] b) { try { fromByteArray(b); return true; } catch (InvalidClassException e) { return false; } }","tryCatchPattern":"try { builder.setBigQueryServices((BigQueryServices) fromByteArray(bytes)); } catch (InvalidClassException e) { builder.setBigQueryServices(new BigQueryServicesImpl()); }","preventionTips":["Declare serialVersionUID in custom BigQueryServices classes.","Deserialize pipelines with the same SDK version that serialized them.","Keep default BigQueryServices as a tested fallback path."],"tags":["bigquery","serialization","upgrade","compatibility"],"backgroundTag":"class-not-found","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"}