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 602d0b6..ac9da46 100644 --- a/src/main/java/com/loafle/overflow/crawler/result/OFResultSetRow.java +++ b/src/main/java/com/loafle/overflow/crawler/result/OFResultSetRow.java @@ -68,14 +68,11 @@ 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(); - boolean find = false; int findIndex = -1; for (String keyColumn: keyColumns) { @@ -92,14 +89,15 @@ public class OFResultSetRow extends OFResultSet{ String metric = metrics.get(findIndex); - for (int i =0 ; i< arrayColumns.size() ; ++i) { - // replace - String k = "$" + i; - int dataIndex = this.meta.get(arrayColumns.get(i)); - String replaceString = data.get(dataIndex); - metric = metric.replace(k,"'" + replaceString + "'"); + if (arrayColumns != null) { + for (int i =0 ; i< arrayColumns.size() ; ++i) { + // replace + String k = "$" + i; + int dataIndex = this.meta.get(arrayColumns.get(i)); + String replaceString = data.get(dataIndex); + metric = metric.replace(k,"'" + replaceString + "'"); + } } - return metric; }