Issue #45: Fix config parser key reading and view ids

Signed-off-by: Lucas Fernandes de Oliveira's avatarLucas Fernandes de Oliveira <lfo14@inf.ufpr.br>
parent 1c178bda
Pipeline #12146 passed with stage
in 1 minute and 47 seconds
...@@ -465,11 +465,19 @@ export class PostgresAdapter extends Adapter { ...@@ -465,11 +465,19 @@ export class PostgresAdapter extends Adapter {
clauses: partial0.clauses.concat(partial1.clauses), clauses: partial0.clauses.concat(partial1.clauses),
materialized: false materialized: false
}); });
const id = new View({
metrics: mets.concat(dimMetrics),
dimensions: dims,
keys: keys,
origin: false,
clauses: partial0.clauses.concat(partial1.clauses),
materialized: false
}).id;
const viewFrom = "(" + const viewFrom = "(" +
this.buildQuery(partial, [partial0, partial1]) + this.buildQuery(partial, [partial0, partial1]) +
") AS view_" + partial0.id + partial1.id + "\n"; ") AS view_" + id + "\n";
partialJoin.push({ partialJoin.push({
id: partial0.id + partial1.id, id: id,
from: viewFrom, from: viewFrom,
dimMetrics: dimMetrics, dimMetrics: dimMetrics,
metrics: mets, metrics: mets,
......
...@@ -185,7 +185,7 @@ export class ConfigParser { ...@@ -185,7 +185,7 @@ export class ConfigParser {
for (let i = 0; i < keys.length; ++i) { for (let i = 0; i < keys.length; ++i) {
if (dimMap[keys[i]]) { if (dimMap[keys[i]]) {
viewOpt.keys.push(dimMap[opts.dimensions[i]]); viewOpt.keys.push(dimMap[opts.keys[i]]);
} }
else { else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment