Relative Content

Tag Archive for google-cloud-dataflowapache-beamapache-beam-io

How to dynamically defined BQ schema in Dataflow / Apache Beam

I’m new to Dataflow/Apache beam. Here, I’m trying to set the BQ schema dynamically by passing the resource_name to get_schema method. When I run this locally using DirectRunner, it works fine and I can see the data ingested into BQ table. However, when I save this script as a Dataflow template, and use Cloud Run Functions to load and execute the template via Dataflow API, it results in an error, indicating that the schema is empty–ostensibly because get_schema is invoked before runtime and resource_name is a RuntimeValueProvider. Incidentally, hardcoding the schema over get_schema will make it work.