Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Read all lines in the query file, and join them to create a single
query or script.
  • Loading branch information
vicenteg committed May 17, 2020
1 parent d796ecc commit 7d7af41
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,17 @@ private List<String> getQueriesFromFiles() {
List<String> queriesFromFiles = new ArrayList<>();

for (String queryFile : queryFiles) {
queriesFromFiles.addAll(readQueryFile(queryFile));
queriesFromFiles.add(readQueryFile(queryFile));
}

return queriesFromFiles;
}

private List<String> readQueryFile(final String queryFile) {
List<String> queries = new ArrayList<>();
private String readQueryFile(final String queryFile) {
List<String> queryLines = new ArrayList<>();

try {
queries =
queryLines =
Resources.readLines(
Resources.getResource(queryFile),
// TODO(ldanielmadariaga): Handle other charsets
Expand All @@ -137,6 +137,6 @@ private List<String> readQueryFile(final String queryFile) {
logger.log(Level.FINE, "Failed to write to query files: ", e);
}

return queries;
return String.join("\n", queryLines);
}
}

0 comments on commit 7d7af41

Please sign in to comment.