{"record":{"id":"8ed72c7e89b6a72e","repo":"apache/beam","slug":"s-s-input-is-expected-to-be-empty","errorCode":null,"errorMessage":"%s %s input is expected to be empty","messagePattern":"(.+?) (.+?) input is expected to be empty","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/BigQueryExportReadSchemaTransformProvider.java","lineNumber":112,"sourceCode":"  protected static class BigQueryExportSchemaTransform extends SchemaTransform {\n    /** An instance of {@link BigQueryServices} used for testing. */\n    private @Nullable BigQueryServices testBigQueryServices = null;\n\n    private final BigQueryExportReadSchemaTransformConfiguration configuration;\n\n    BigQueryExportSchemaTransform(BigQueryExportReadSchemaTransformConfiguration configuration) {\n      this.configuration = configuration;\n    }\n\n    @VisibleForTesting\n    void setTestBigQueryServices(BigQueryServices testBigQueryServices) {\n      this.testBigQueryServices = testBigQueryServices;\n    }\n\n    @Override\n    public PCollectionRowTuple expand(PCollectionRowTuple input) {\n      if (!input.getAll().isEmpty()) {\n        throw new IllegalArgumentException(\n            String.format(\n                \"%s %s input is expected to be empty\",\n                input.getClass().getSimpleName(), getClass().getSimpleName()));\n      }\n\n      BigQueryIO.TypedRead<TableRow> read = toTypedRead();\n      if (testBigQueryServices != null) {\n        read = read.withTestServices(testBigQueryServices).withoutValidation();\n      }\n\n      PCollection<TableRow> tableRowPCollection = input.getPipeline().apply(read);\n      Schema schema = tableRowPCollection.getSchema();\n      PCollection<Row> rowPCollection =\n          tableRowPCollection.apply(\n              MapElements.into(TypeDescriptor.of(Row.class))\n                  .via((tableRow) -> BigQueryUtils.toBeamRow(schema, tableRow)));\n      return PCollectionRowTuple.of(OUTPUT_TAG, rowPCollection.setRowSchema(schema));\n    }","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryExportReadSchemaTransformProvider.java#L94-L130","documentation":"BigQueryExportReadSchemaTransformProvider's expand() rejects any non-empty PCollectionRowTuple input; this SchemaTransform reads directly from BigQuery via export and therefore must have no input PCollections. The library throws IllegalArgumentException eagerly so a mis-wired pipeline fails at graph construction instead of silently hanging waiting for input it will never consume.","triggerScenarios":"Calling .expand(PCollectionRowTuple) with a tuple containing one or more named input Pcollections, e.g. wiring an upstream transform's output into the BigQuery export read SchemaTransform via PCollectionRowTuple.of(...).","commonSituations":"Building SchemaTransform pipelines with the SchemaTransformProvider API where a developer accidentally connects the output of a previous stage (e.g. a read or SQL transform) into this read-only root transform; YAML/Java pipeline composition tools that mis-map input tuple tags.","solutions":["Do not connect any PCollection into this transform; invoke expand with an empty PCollectionRowTuple, e.g. PCollectionRowTuple.empty(pipeline) or the provider's from()/buildTransform() with no inputs.","If you meant to write data to BigQuery, use a BigQuery write SchemaTransform or BigQueryIO.write instead of the export read transform.","Review the pipeline graph wiring (tuple tags) so only side-input-free root transforms feed this provider."],"exampleFix":"// before\nPCollectionRowTuple input = PCollectionRowTuple.of(\"rows\", rows);\nPCollectionRowTuple output = bigqueryExportRead.expand(input);\n\n// after\nPCollectionRowTuple empty = PCollectionRowTuple.empty(rows.getPipeline());\nPCollectionRowTuple output = bigqueryExportRead.expand(empty);","handlingStrategy":"validation","validationCode":"if (input != null && !input.getAll().isEmpty()) {\n  throw new IllegalArgumentException(\n      \"BigQuery export read SchemaTransform accepts no inputs; got: \" + input.getAll().keySet());\n}","typeGuard":null,"tryCatchPattern":"try {\n  output = transform.expand(input);\n} catch (IllegalArgumentException e) {\n  // rewire pipeline so no PCollection feeds the export read transform\n}","preventionTips":["Treat export-read SchemaTransforms as root transforms: never wire inputs into them.","Use PCollectionRowTuple.empty(pipeline) when composing programmatically.","Review tuple tag mappings when building pipelines from YAML/config."],"tags":["java","bigquery","pipeline-validation","illegal-argument"],"backgroundTag":"empty-required-field","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"}