Merge remote-tracking branch 'origin/master'

This commit is contained in:
snoop 2017-04-25 18:27:15 +09:00
commit 6eda977943

View File

@ -25,14 +25,20 @@ public class OFResultSetRow extends OFResultSet{
List<String> arrayColumns = (List<String>) this.item.getQuery().getQueryInfo().get("arrayColumns");
List<String> keyColumns = (List<String>) 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<String> metrics = this.item.getMetrics();
// 동적 키인지 일반 키들인지 체크해야함 // 일단은 동적 키적용
String metricsType = (String) query.getQueryInfo().get("metricsType");
List<String> arrayColumns = (List<String>) this.item.getQuery().getQueryInfo().get("arrayColumns");
List<String> keyColumns = (List<String>) this.item.getQuery().getQueryInfo().get("keyColumns");
List<String> keys = query.getKeys();
// 동적 키인지 일반 키들인지 체크해야함 // 일단은 동적 키적용
String metricsType = (String) query.getQueryInfo().get("metricsType");
boolean find = false;
int findIndex = -1;
@ -88,10 +95,12 @@ public class OFResultSetRow extends OFResultSet{
for (int i =0 ; i< arrayColumns.size() ; ++i) {
// replace
String k = "$" + i;
metric = metric.replace(k,data.get(this.meta.get(arrayColumns.get(i))));
int dataIndex = this.meta.get(arrayColumns.get(i));
String replaceString = data.get(dataIndex);
metric = metric.replace(k,"'" + replaceString + "'");
}
return metric;
}
}