I faced same error: https://issues.apache.org/jira/browse/BEAM-2834 using Google-Provided Cloud Dataflow Pubsub-to-BigQuery template.
This issue was fixed and published included by v2.2.0, but template has not been fixed yet.
reference:
- https://issuetracker.google.com/issues/63124894
- https://stackoverflow.com/questions/44718323/apache-beam-with-dataflow-nullpointer-when-reading-from-bigquery