I'm having trouble specifying a TableSchema in Google's Dataflow template for for reading a pub-sub subscription and streaming into BigQuery.
Template provided here - https://github.com/GoogleCloudPlatform/DataflowTemplates/blob/master/src/main/java/com/google/cloud/teleport/templates/PubSubToBigQuery.java
Per documentation here - https://beam.apache.org/documentation/io/built-in/google-bigquery/#creating-a-table-schema
I attempted to add TableSchema to match my destination in BigQuery
/** Define Table Schema */
TableSchema schema = new TableSchema()
.setFields(
ImmutableList.of(
new TableFieldSchema()
.setName("device_id")
.setType("STRING")
.setMode("NULLABLE"),
new TableFieldSchema()
.setName("timestamp")
.setType("TIMESTAMP")
.setMode("NULLABLE"),
new TableFieldSchema()
.setName("orientation")
.setType("FLOAT")
.setMode("NULLABLE"),
new TableFieldSchema()
.setName("orientation")
.setType("STRING")
.setMode("NULLABLE"),
new TableFieldSchema()
.setName("light_level")
.setType("FLOAT")
.setMode("NULLABLE"),
new TableFieldSchema()
.setName("temperature")
.setType("FLOAT")
.setMode("NULLABLE"),
new TableFieldSchema()
.setName("button_pressed")
.setType("BOOLEAN")
.setMode("NULLABLE"),
new TableFieldSchema()
.setName("city")
.setType("STRING")
.setMode("NULLABLE"),
new TableFieldSchema()
.setName("region")
.setType("string")
.setMode("NULLABLE"),
new TableFieldSchema()
.setName("lat")
.setType("STRING")
.setMode("NULLABLE"),
new TableFieldSchema()
.setName("long")
.setType("string")
.setMode("NULLABLE")));
Here's the error I get when trying to compile.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile (default-compile) on project google-cloud-teleport-java: Compilation failure [ERROR] /home/jquattlebaum/DataflowTemplates/src/main/java/com/google/cloud/teleport/templates/PubSubToBigQuery.java:[131,5] cannot find symbol [ERROR] symbol: class TableSchema [ERROR]
location: class com.google.cloud.teleport.templates.PubSubToBigQuery