Skip to content
Snippets Groups Projects
Commit 7ae82906 authored by Karin Pettersen's avatar Karin Pettersen
Browse files

Created sort DB file

parent 7347e0be
No related branches found
No related tags found
Loading
......@@ -87,21 +87,30 @@ public class DB {
return credentials;
}
private static BigQuery getBuilder() throws Exception {
BigQuery bigquery = BigQueryOptions.newBuilder().
setCredentials(getCredentials()).
setProjectId("sf-drying-optimization")
.build().getService();
return bigquery;
}
private static void getFromExistingTable() throws Exception {
// Step 1: Initialize BigQuery service
// Here we set our project ID and get the `BigQuery` service object
// this is the interface to our BigQuery instance that
// we use to execute jobs on
BigQuery bigquery = BigQueryOptions.newBuilder().
setCredentials(getCredentials()).
setProjectId("sf-drying-optimization")
.build().getService();
BigQuery bigquery = getBuilder();
// Step 2: Prepare query job
// A "QueryJob" is a type of job that executes SQL queries
// we create a new job configuration from our SQL query and
final String GET_WORD_COUNT = "SELECT VariantValue, TimeStamp FROM sf-drying-optimization.124.int_sd_winccsensordata WHERE TimeStamp BETWEEN \"2020-06-09\" AND \"2020-06-29\" ORDER BY TimeStamp";
final String GET_WORD_COUNT = "SELECT VariantValue, TimeStamp FROM sf-drying-optimization.124.int_sd_winccsensordata " +
"WHERE TimeStamp BETWEEN \"2020-06-09\" AND \"2020-06-29\" ORDER BY TimeStamp";
QueryJobConfiguration queryConfig =
QueryJobConfiguration.newBuilder(GET_WORD_COUNT).build();
......
File deleted
No preview for this file type
File deleted
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment