From 02627779aec7826e3629d7158d0842bffb01ef7b Mon Sep 17 00:00:00 2001 From: Vince Gonzalez Date: Sat, 16 May 2020 22:49:38 -0400 Subject: [PATCH 1/2] fix issue #244 Read all lines in the query file, and join them to create a single query or script. --- .../google/cloud/pontem/config/WorkloadSettings.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BigQueryWorkloadTester/src/main/java/com/google/cloud/pontem/config/WorkloadSettings.java b/BigQueryWorkloadTester/src/main/java/com/google/cloud/pontem/config/WorkloadSettings.java index 5ea32e0..15d69e5 100644 --- a/BigQueryWorkloadTester/src/main/java/com/google/cloud/pontem/config/WorkloadSettings.java +++ b/BigQueryWorkloadTester/src/main/java/com/google/cloud/pontem/config/WorkloadSettings.java @@ -108,17 +108,17 @@ private List getQueriesFromFiles() { List queriesFromFiles = new ArrayList<>(); for (String queryFile : queryFiles) { - queriesFromFiles.addAll(readQueryFile(queryFile)); + queriesFromFiles.add(readQueryFile(queryFile)); } return queriesFromFiles; } - private List readQueryFile(final String queryFile) { - List queries = new ArrayList<>(); + private String readQueryFile(final String queryFile) { + List queryLines = new ArrayList<>(); try { - queries = + queryLines = Resources.readLines( Resources.getResource(queryFile), // TODO(ldanielmadariaga): Handle other charsets @@ -128,6 +128,6 @@ private List readQueryFile(final String queryFile) { logger.log(Level.FINE, "Failed to write to query files: ", e); } - return queries; + return String.join("\n", queryLines); } } From d07f29d10fe183d525e6104993ed67f8595d3420 Mon Sep 17 00:00:00 2001 From: Vince Gonzalez Date: Sat, 16 May 2020 16:36:22 -0400 Subject: [PATCH 2/2] fix #242 --- BigQueryWorkloadTester/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BigQueryWorkloadTester/build.gradle b/BigQueryWorkloadTester/build.gradle index 0315271..074d8cd 100644 --- a/BigQueryWorkloadTester/build.gradle +++ b/BigQueryWorkloadTester/build.gradle @@ -26,13 +26,14 @@ targetCompatibility = 1.8 repositories { maven { url "https://repository.apache.org/content/repositories/snapshots/" } - maven { url "http://repo.maven.apache.org/maven2" } + maven { url "https://repo.maven.apache.org/maven2" } } dependencies { compile group: 'com.google.api', name: 'gax-grpc', version: '1.37.0' compile group: 'com.google.auto.value', name: 'auto-value', version: '1.6.3' compile group: 'com.google.auto.value', name: 'auto-value-annotations', version: '1.6.3' + annotationProcessor group: 'com.google.auto.value', name: 'auto-value', version: '1.6.3' compile group: 'com.google.cloud', name: 'google-cloud-bigquery', version:'1.56.0' compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5' compile group: 'com.google.guava', name: 'guava', version:'20.0'