From 64a106489c144abc5a00d5ca4d60a519dac7e4f0 Mon Sep 17 00:00:00 2001 From: "jackdaw@loafle.com" Date: Tue, 25 Apr 2017 18:37:41 +0900 Subject: [PATCH 1/2] result set --- .../com/loafle/overflow/crawler/result/OFResultSetRow.java | 3 --- 1 file changed, 3 deletions(-) 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..557b99c 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) { From aca84b33714cbca4033ca1d4a3819359d95b7c45 Mon Sep 17 00:00:00 2001 From: "jackdaw@loafle.com" Date: Tue, 25 Apr 2017 18:38:25 +0900 Subject: [PATCH 2/2] result set --- .../overflow/crawler/result/OFResultSetRow.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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 557b99c..ac9da46 100644 --- a/src/main/java/com/loafle/overflow/crawler/result/OFResultSetRow.java +++ b/src/main/java/com/loafle/overflow/crawler/result/OFResultSetRow.java @@ -89,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; }