Skip to main content
Version: 3.0 (next)

MaestroHub and BigQuery

Send plant data to BigQuery through Pub/Sub or as files in Cloud Storage, start Dataflow jobs from a pipeline, and read results back to the line.

Connectors
Google Pub/Sub · GCS · Cloud Dataflow · BigQuery
Start with
A · Pub/Sub with a BigQuery subscription
Network
Outbound HTTPS 443 to Google Cloud

Rows reach BigQuery through Google Cloud services that Context Engine already connects to: a Google Pub/Sub topic with a BigQuery subscription writes each message as a row, and GCS holds files that BigQuery loads. The BigQuery connector reads results back.

Find your route​

Answer a few questions; the drawing below follows your answer.

Where does the data go?
How fresh must it be?
What can the plant reach?

AThrough Pub/Sub. Continuous data that should be queryable within seconds, with no job to run.

Architecture​

Context Engine runs next to your machines, and every route starts or ends there. Select a route to trace it.

Into BigQuery
Back to the plant
PLANTYOUR NETWORK OR CLOUD, OPTIONALBIGQUERYSourcesPLCs, OPC UAMQTT, MESHistoriansShop floorUNS, setpointsTeams, SlackContext Enginepipelines, UNSTablesand viewsAGoogle Pub/SubPublishPub/Sub topicin your projectBigQuery subscriptioneach message becomes a rowBConvert to Parquetto GCSCloud StorageParquet, partitioned by timeLoad or BigLake tablescheduled load or external tableCCloud DataflowLaunchGoogle Cloud API over HTTPS 443Dataflow jobfor example GCS to BigQueryDBigQueryQueryGoogle Cloud API over HTTPS 443Query jobbilled by bytes scanned
  • Set up in MaestroHub
  • Your infrastructure
  • Set up in BigQuery
AThrough Pub/Sub. Seconds. No job runs; billed by volume. What each side sets up

Routes​

A

Into BigQuery

Through Pub/Sub​

Start here for machine data
Freshness
Seconds
BigQuery compute
No job runs; billed by volume
Delivery
At least once; keep a message ID column to remove duplicates

In MaestroHub

  1. Create a Google Pub/Sub connection with a service account key.
  2. Add a Publish node whose JSON fields match the table columns.
  3. Keep store-and-forward on the node.

In BigQuery

  1. Create the table.
  2. Create a BigQuery subscription on the topic that uses the table schema.
  3. Grant the Pub/Sub service agent BigQuery Data Editor on the table.

Choose it when Continuous data that should be queryable within seconds, with no job to run.

Look elsewhere when Large backfills from a historian: use B.

Google Pub/Sub guide

B

Into BigQuery

Land files in Cloud Storage​

For bulk volume and backfills
Freshness
Your load schedule
BigQuery compute
Batch loads use free shared slots; external tables bill per query
Delivery
Partition by path so a rerun replaces one partition

In MaestroHub

  1. Batch rows with a Buffer or Aggregator node so each call carries many rows.
  2. Add Convert to File with format Parquet and a declared column schema.
  3. Write with the GCS node, Input Format base64, to a dated path.

In BigQuery

  1. Grant the service account Storage Object Creator on the bucket.
  2. Schedule a Cloud Storage transfer into the table, or define an external BigLake table on the path.

Choose it when Large volumes where minutes or hours are fine.

Look elsewhere when You need seconds: use A.

Convert to FileGCS guide

C

Into BigQuery

Start Dataflow jobs​

Start heavy loads on the plant's schedule
Freshness
Your batch schedule
BigQuery compute
Dataflow workers while the job runs
Delivery
Follow job state and metrics from the pipeline

In MaestroHub

  1. Create a Google Cloud Dataflow connection whose identity has roles/dataflow.developer.
  2. Pipeline: a trigger, then Launch a Flex or classic template with parameters, then follow its state and alert on failure.

In BigQuery

  1. A Google-provided or custom template that writes BigQuery.

Choose it when A load or transform should start when the plant finishes a batch or a shift.

Look elsewhere when You only need to land rows: A or B is simpler.

Dataflow guide

D

Back to the plant

Read results back​

Close the loop on a schedule
Freshness
Your schedule
BigQuery compute
Each query bills the bytes it scans
Delivery
Reads current state; safe to repeat

In MaestroHub

  1. Build a Query function. A result returns up to 50,000 rows or 40 MB by default.
  2. Pipeline: Schedule trigger, then the query, then publish to a UNS topic or write a setpoint through the machine's connector.

In BigQuery

  1. A small, partitioned results table so each query scans little, with BigQuery Data Viewer granted.

Choose it when Analytics or models in BigQuery produce values the plant should use.

Look elsewhere when Large exports: write them to Cloud Storage and read the files instead.

BigQuery guideSchedule trigger

Writing to BigQuery

The BigQuery connector runs queries; this page does not cover writing rows through it. Rows go in through Pub/Sub (A) or files (B).

Compare the routes​

Routes combine: most plants run one route in and one route back.

RouteDirectionFreshnessBigQuery computeDeliveryNetworkBest for
Into BigQuerySecondsNo job runs; billed by volumeAt least once; keep a message ID column to remove duplicatesOutbound HTTPS 443 to Google CloudTelemetry and events
Into BigQueryYour load scheduleBatch loads use free shared slots; external tables bill per queryPartition by path so a rerun replaces one partitionOutbound HTTPS 443 to Google CloudHistorian backfills, large daily volumes
Into BigQueryYour batch scheduleDataflow workers while the job runsFollow job state and metrics from the pipelineOutbound HTTPS 443 to Google CloudTransforms and backfills started and watched from MaestroHub
Back to the plantYour scheduleEach query bills the bytes it scansReads current state; safe to repeatOutbound HTTPS 443 to Google CloudPredictions, targets, master data