Fix layouts to use groupby and quote host
parent
116f45bf56
commit
ed525a81ee
|
@ -45,12 +45,12 @@ export const LayoutRenderer = React.createClass({
|
||||||
return this.props.cells.map((cell) => {
|
return this.props.cells.map((cell) => {
|
||||||
const qs = cell.queries.map((q) => {
|
const qs = cell.queries.map((q) => {
|
||||||
_.merge(q, {host: source});
|
_.merge(q, {host: source});
|
||||||
q.text += ` where host = '${host}' and time > ${timeRange}`;
|
q.text += ` where \"host\" = '${host}' and time > ${timeRange}`;
|
||||||
if (q.wheres && q.wheres.length > 0) {
|
if (q.wheres && q.wheres.length > 0) {
|
||||||
q.text += ` and ${q.wheres.join(' and ')}`;
|
q.text += ` and ${q.wheres.join(' and ')}`;
|
||||||
}
|
}
|
||||||
if (q.groupbys && q.groupbys.length > 0) {
|
if (q.groupbys && q.groupbys.length > 0) {
|
||||||
q.text += ` group by ${q.groupBys.join(',')}`;
|
q.text += ` group by ${q.groupbys.join(',')}`;
|
||||||
}
|
}
|
||||||
return q;
|
return q;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue