Skip to content

Commit 041f312

Browse files
mmerdesrtroilo
authored andcommitted
#470: simplify method implementation
1 parent d967e6c commit 041f312

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

oshdb-api/src/main/java/org/heigit/ohsome/oshdb/api/mapreducer/backend/MapReducerJdbc.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.heigit.ohsome.oshdb.api.mapreducer.backend;
22

3+
import static java.util.stream.Collectors.joining;
4+
35
import java.io.IOException;
46
import java.io.ObjectInputStream;
57
import java.sql.ResultSet;
@@ -58,13 +60,13 @@ protected GridOSHEntity readOshCellRawData(ResultSet oshCellsRawData)
5860
}
5961

6062
protected String sqlQuery() {
61-
var sqlQuery = this.typeFilter.stream()
62-
.map(
63-
osmType -> TableNames.forOSMType(osmType).map(tn -> tn.toString(this.oshdb.prefix())))
64-
.filter(Optional::isPresent).map(Optional::get)
63+
return this.typeFilter.stream()
64+
.map(osmType -> TableNames.forOSMType(osmType)
65+
.map(tn -> tn.toString(this.oshdb.prefix())))
66+
.filter(Optional::isPresent)
67+
.map(Optional::get)
6568
.map(tn -> "(select data from " + tn + " where level = ?1 and id between ?2 and ?3)")
66-
.collect(Collectors.joining(" union all "));
67-
return sqlQuery;
69+
.collect(joining(" union all "));
6870
}
6971

7072
@Nonnull

0 commit comments

Comments
 (0)