diff --git a/src/main/java/com/loafle/overflow/crawler/result/OFResultSetRow.java b/src/main/java/com/loafle/overflow/crawler/result/OFResultSetRow.java index b0ade53..602d0b6 100644 --- a/src/main/java/com/loafle/overflow/crawler/result/OFResultSetRow.java +++ b/src/main/java/com/loafle/overflow/crawler/result/OFResultSetRow.java @@ -25,14 +25,20 @@ public class OFResultSetRow extends OFResultSet{ List arrayColumns = (List) this.item.getQuery().getQueryInfo().get("arrayColumns"); List keyColumns = (List) this.item.getQuery().getQueryInfo().get("keyColumns"); String valueColumn = (String) this.item.getQuery().getQueryInfo().get("valueColumn"); + if (arrayColumns != null) { + for (String c : arrayColumns) { + meta.add(c); + } + } - for (String c : arrayColumns) { - meta.add(c); + if (keyColumns != null) { + for (String c: keyColumns) { + meta.add(c); + } } - for (String c: keyColumns) { - meta.add(c); - } - meta.add(valueColumn); + + if (valueColumn != null && !valueColumn.equals("")) + meta.add(valueColumn); if(this.meta == null) { this.meta = new HashMap<>(); @@ -62,12 +68,13 @@ public class OFResultSetRow extends OFResultSet{ Query query = this.item.getQuery(); List metrics = this.item.getMetrics(); + // 동적 키인지 일반 키들인지 체크해야함 // 일단은 동적 키적용 + String metricsType = (String) query.getQueryInfo().get("metricsType"); + List arrayColumns = (List) this.item.getQuery().getQueryInfo().get("arrayColumns"); List keyColumns = (List) this.item.getQuery().getQueryInfo().get("keyColumns"); List keys = query.getKeys(); - // 동적 키인지 일반 키들인지 체크해야함 // 일단은 동적 키적용 - String metricsType = (String) query.getQueryInfo().get("metricsType"); boolean find = false; int findIndex = -1; @@ -94,6 +101,6 @@ public class OFResultSetRow extends OFResultSet{ } return metric; - } + }