BigQuery Data Transfer Service features an API that allows developers to create transfer jobs from data sources to BigQuery. These sample Java applications demonstrate how to access the BigQuery Data Transfer API using the Google Cloud Client Library for Java.
Install Maven.
Authenticate using a service account.
Create a service account, download a JSON key file, and set the GOOGLE_APPLICATION_CREDENTIALS environment variable.
Build your project with:
mvn clean package -DskipTests
You can then run a given ClassName via:
mvn exec:java -Dexec.mainClass=com.example.bigquerydatatransfer.ClassName \
-DpropertyName=propertyValue \
-Dexec.args="any arguments to the app"
mvn exec:java -Dexec.mainClass=com.example.bigquerydatatransfer.QuickstartSample \
-Dexec.args='YOUR_PROJECT_ID'