//File credentialsPath = new File(".\\src\\main\\resources\\com.application\\sf-drying-optimization-1e234ad2b0f4.json");
File credentialsPath = new File("/Users/Madzarn/Desktop/bacheloroppgave_2022/src/main/resources/com.application/sf-drying-optimization-1e234ad2b0f4.json");
// Load credentials from JSON key file. If you can't set the GOOGLE_APPLICATION_CREDENTIALS
// environment variable, you can explicitly load the credentials file to construct the
...
...
@@ -98,10 +102,17 @@ public class DB {
setProjectId("sf-drying-optimization")
.build().getService();
//final String GET_WORD_COUNT = "SELECT InTidTork, UtTidTork FROM sf-drying-optimization.124.int_gs_ds_sipalpackages WHERE InTidTork BETWEEN \"2020-05-14 12:51:03\" AND \"2020-05-17 16:10:09\" ORDER BY InTidTork";
// 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
finalStringGET_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 " +
// 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
BigQuerybigquery=BigQueryOptions.newBuilder().
setCredentials(getCredentials2()).
setProjectId("sf-drying-optimization")
.build().getService();
// 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
finalStringGET_WORD_COUNT="SELECT CalculatedStart, CalculatedStop FROM sf-drying-optimization.124.int_dk_valmaticsdryingbatches WHERE CalculatedStart BETWEEN \"2021-08-17 07:53:21\" AND \"2021-10-02 14:42:39\" ORDER BY CalculatedStart";