code: def run_beam_pipeline():
      """Run the apache beam pipeline with the specified flags."""
  
      # Params used for running the Beam pipeline. Update these based on your
      # requirements.
      params = {}
      # Specify the projectid for BigQuery
      params["projectId"] = "my_project_id"
      # Specify the datasetid for BigQuery
      params["datasetId"] = "my_dataset_id"
      # Specify the table for BigQuery
      params["tableId"] = "my_table_id"
      # Specify the list of flags for the Beam pipeline
      params["flags"] = ["--temp_location=my_temp_location"]
      # Specify the desination for the generated examples.
      params["destination"] = "my_destination"
  
      table_spec = bigquery.TableReference(
          projectId=params["projectId"],
          datasetId=params["datasetId"],
          tableId=params["tableId"],
      )
      with beam.Pipeline(
          options=beam.options.pipeline_options.PipelineOptions(
              flags=params["flags"]
          )
      ) as p:
          _ = (
              p
              | "ReadTable"
              >> beam.io.ReadFromBigQuery(table=table_spec)
              | "ConvertToTensorFlowExamples"
              >> beam.ParDo(ExampleGeneratingDoFn())
              | "Write"
              >> beam.io.tfrecordio.WriteToTFRecord(
                  "gs://tfxdata/data/output",
                  coder=beam.coders.ProtoCoder(tf.train.Example),
                  file_name_suffix=".tfrecord.gz",
              )
          )
  
file_path: tfx/tfx/examples/tfjs_next_page_prediction/bigquery_beam_data_generation.py
imports: from typing import Any, Dict, List, Union
  import apache_beam
  from apache_beam.io.gcp.internal.clients import bigquery
  import tensorflow
label_desc: Use image node_id 5 for calling a global function with example usage: run_beam_pipeline() without return types