{"record":{"id":"176777d8272829a5","repo":"apache/beam","slug":"bigqueryio-write-transforms-cannot-be-converted-to-a","errorCode":null,"errorMessage":"BigQueryIO.Write transforms cannot be converted to a portable row based config due to 'withSchemaFromView' property being set. Please retry without setting this property when configuring your transform","messagePattern":"BigQueryIO\\.Write transforms cannot be converted to a portable row based config due to 'withSchemaFromView' property being set\\. Please retry without setting this property when configuring your transform","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/BigQueryIOTranslation.java","lineNumber":542,"sourceCode":"      }\n      Object formatRecordOnFailureFunction = transform.getFormatRecordOnFailureFunction();\n      if (formatRecordOnFailureFunction != null) {\n        fieldValues.put(\n            \"format_record_on_failure_function\", toByteArray(formatRecordOnFailureFunction));\n      }\n      Object avroRowWriterFactory = transform.getAvroRowWriterFactory();\n      if (avroRowWriterFactory != null) {\n        fieldValues.put(\"avro_row_writer_factory\", toByteArray(avroRowWriterFactory));\n      }\n      fieldValues.put(\"use_avro_logical_types\", transform.getUseAvroLogicalTypes());\n      Object dynamicDestinations = transform.getDynamicDestinations();\n      if (dynamicDestinations != null) {\n        fieldValues.put(\"dynamic_destinations\", toByteArray(dynamicDestinations));\n      }\n      if (transform.getSchemaFromView() != null) {\n        // Property 'getSchemaFromView' cannot be used in a portable way across pipelines since it\n        // is bound to PCollections generated for the current pipeline instance.\n        throw new IllegalArgumentException(\n            \"BigQueryIO.Write transforms cannot be converted to a \"\n                + \"portable row based config due to 'withSchemaFromView' property being set. Please \"\n                + \"retry without setting this property when configuring your transform\");\n      }\n      ValueProvider<String> jsonSchema = transform.getJsonSchema();\n      if (jsonSchema != null) {\n        fieldValues.put(\"json_schema\", jsonSchema.get());\n      }\n      ValueProvider<String> jsonTimePartitioning = transform.getJsonTimePartitioning();\n      if (jsonTimePartitioning != null) {\n        fieldValues.put(\"json_time_partitioning\", toByteArray(jsonTimePartitioning.get()));\n      }\n      ValueProvider<String> jsonClustering = transform.getJsonClustering();\n      if (jsonClustering != null) {\n        fieldValues.put(\"clustering\", jsonClustering.get());\n      }\n      if (transform.getCreateDisposition() != null) {\n        fieldValues.put(\"create_disposition\", toByteArray(transform.getCreateDisposition()));","sourceCodeStart":524,"sourceCodeEnd":560,"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#L524-L560","documentation":"BigQueryIOTranslation.toConfigRow converts a BigQueryIO.Write transform into a portable Row-based configuration for cross-language pipelines. The withSchemaFromView property stores a reference to a PCollectionView bound to the current pipeline instance, which cannot be serialized portably, so the translation throws IllegalArgumentException and asks the caller to configure the transform without it.","triggerScenarios":"Expanding a BigQueryIO.Write built with .withSchemaFromView(pCollectionView) inside a portable/cross-language (e.g. Python runner via expansion service) pipeline, when toConfigRow is invoked during translation.","commonSituations":"Java pipelines consumed from Python via cross-language transforms; dynamic per-window schemas configured with SchemaFromView then submitted to a portable runner; template/URN-based translation paths that must round-trip the transform config.","solutions":["Remove .withSchemaFromView(...) and instead set a static schema with .withJsonSchema(...) or .withSchema(...) / fromValue(...).","If schemas must be dynamic per destination, use DynamicDestinations with getSchema() instead of a schema view.","Keep the pipeline entirely on a non-portable Java runner if schema-from-view is essential (it is only usable in non-portable pipelines).","Upgrade Beam to a version whose portable path supports your configuration pattern, if available."],"exampleFix":"// before\nBigQueryIO.write().withSchemaFromView(schemaView)\n// after\nBigQueryIO.write().to(new DynamicDestinations<TableRow, String>() {\n  public TableDestination getDestination(TableRow row) { ... }\n  public TableSchema getSchema(String dest) { ... }\n})","handlingStrategy":"validation","validationCode":"if (writeTransform.getSchemaFromView() != null && isPortableOrCrossLanguagePipeline()) {\n  throw new IllegalArgumentException(\"withSchemaFromView is not portable; use DynamicDestinations or a static schema\");\n}","typeGuard":"static boolean isPortableSafe(Write<?> w) {\n  return w.getSchemaFromView() == null;\n}","tryCatchPattern":"try {\n  row = BigQueryIOTranslation.toConfigRow(transform, ...);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"withSchemaFromView\")) {\n    throw new IllegalStateException(\"Reconfigure the transform with a static schema or DynamicDestinations for portability\", e);\n  } else { throw e; }\n}","preventionTips":["Avoid withSchemaFromView entirely in cross-language or portable pipelines.","Use DynamicDestinations.getSchema() for runtime-computed schemas.","Document schema strategy in shared transform factories so downstream languages stay compatible."],"tags":["java","bigquery","apache-beam","portability","cross-language"],"backgroundTag":"conflicting-config-options","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"}