Skip to content

Commit

Permalink
https://github.com/yzhang921/CBoard/issues/117
Browse files Browse the repository at this point in the history
replace null with #NULL for queryAggData result
  • Loading branch information
yzhang921 committed Jun 1, 2017
1 parent e3e8a29 commit 9aad343
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/cboard/jdbc/JdbcDataProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,12 @@ public AggregateResult queryAggData(AggConfig config) throws Exception {
List<ColumnIndex> dimensionList = dimStream.map(ColumnIndex::fromDimensionConfig).collect(Collectors.toList());
dimensionList.addAll(config.getValues().stream().map(ColumnIndex::fromValueConfig).collect(Collectors.toList()));
IntStream.range(0, dimensionList.size()).forEach(j -> dimensionList.get(j).setIndex(j));
int dimSize = dimensionList.stream().filter(i -> i.getAggType() == null).toArray().length;
list.forEach(row -> {
IntStream.range(0, dimSize).forEach(i -> {
if (row[i] == null) row[i] = NULL_STRING;
});
});
String[][] result = list.toArray(new String[][]{});
return new AggregateResult(dimensionList, result);
}
Expand Down

0 comments on commit 9aad343

Please sign in to comment.