{"record":{"id":"d936e801cd428c44","repo":"apache/beam","slug":"provided-transform-name-mapping-for-a-batch-pipeline-did-you","errorCode":null,"errorMessage":"provided transform_name_mapping for a batch pipeline, did you mean to construct a streaming pipeline?","messagePattern":"provided transform_name_mapping for a batch pipeline, did you mean to construct a streaming pipeline\\?","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/dataflow/dataflow.go","lineNumber":310,"sourceCode":"\t\tperf.EnableProfCaptureHook(\"gcs_profile_writer\", *cpuProfiling)\n\t}\n\n\tif *autoscalingAlgorithm != \"\" {\n\t\tif *autoscalingAlgorithm != \"NONE\" && *autoscalingAlgorithm != \"THROUGHPUT_BASED\" {\n\t\t\treturn nil, errors.New(\"invalid autoscaling algorithm. Use --autoscaling_algorithm=(NONE|THROUGHPUT_BASED)\")\n\t\t}\n\t}\n\n\tif *flexRSGoal != \"\" {\n\t\tswitch *flexRSGoal {\n\t\tcase \"FLEXRS_UNSPECIFIED\", \"FLEXRS_SPEED_OPTIMIZED\", \"FLEXRS_COST_OPTIMIZED\":\n\t\t\t// valid values\n\t\tdefault:\n\t\t\treturn nil, errors.Errorf(\"invalid flex resource scheduling goal. Got %q; Use --flexrs_goal=(FLEXRS_UNSPECIFIED|FLEXRS_SPEED_OPTIMIZED|FLEXRS_COST_OPTIMIZED)\", *flexRSGoal)\n\t\t}\n\t}\n\tif !streaming && *transformMapping != \"\" {\n\t\treturn nil, errors.New(\"provided transform_name_mapping for a batch pipeline, did you mean to construct a streaming pipeline?\")\n\t}\n\tif !*update && *transformMapping != \"\" {\n\t\treturn nil, errors.New(\"provided transform_name_mapping without setting the --update flag, so the pipeline would not be updated\")\n\t}\n\tvar updateTransformMapping map[string]string\n\tif *transformMapping != \"\" {\n\t\tif err := json.Unmarshal([]byte(*transformMapping), &updateTransformMapping); err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"error reading --transform_name_mapping flag as JSON\")\n\t\t}\n\t}\n\tif *usePublicIPs == *noUsePublicIPs {\n\t\tuseSet := isFlagPassed(\"use_public_ips\")\n\t\tnoUseSet := isFlagPassed(\"no_use_public_ips\")\n\t\t// If use_public_ips was explicitly set but no_use_public_ips was not, use that value\n\t\t// We take the explicit value of no_use_public_ips if it was set but use_public_ips was not.\n\t\tif useSet && !noUseSet {\n\t\t\t*noUsePublicIPs = !*usePublicIPs\n\t\t} else if useSet && noUseSet {","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/dataflow/dataflow.go#L292-L328","documentation":"transform_name_mapping is only meaningful for streaming Dataflow job updates (mapping transform names so an update replaces the right stages). getJobOptions rejects the flag when the pipeline was constructed as batch (streaming=false), because batch jobs cannot use name-mapped updates.","triggerScenarios":"Submitting a batch pipeline (no streaming option / source is bounded) while --transform_name_mapping=<json> is set.","commonSituations":"Reusing a streaming launch script's flag set for a batch job; leaving the flag in CI config after switching the pipeline to batch.","solutions":["Remove --transform_name_mapping for batch pipelines","If an update is intended, construct the pipeline as streaming (withbeam.Streaming / --streaming) so the flag is allowed","Also ensure --update is set, since a second check requires it when the mapping is present"],"exampleFix":"// before\n--streaming=false --update --transform_name_mapping='{\"old\":\"new\"}'\n// after\n--streaming --update --transform_name_mapping='{\"old\":\"new\"}'","handlingStrategy":"validation","validationCode":"if transformMapping != \"\" && !streaming {\n    return errors.New(\"transform_name_mapping requires a streaming pipeline\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep separate flag profiles for batch vs streaming submissions","Only set transform_name_mapping in streaming update launches"],"tags":["go","dataflow","streaming","flag-conflict"],"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"}