Commit 562d002f authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira

Merge branch 'issue/26' into 'master'

Issue #26: Fix name pattern

See merge request !18
parents 04f0a1f3 32c9f032
Pipeline #11075 passed with stage
in 42 seconds
......@@ -83,7 +83,7 @@ function createView(view: View): string {
let keys = [];
for (let field in view.fields) {
props.push("\"" + field + "\" " + typeConvertion(view.fields[field]));
keys.push(field.name);
keys.push(field);
}
keys.sort();
let name = "view_" + Hash.sha1(keys);
......
......@@ -3,17 +3,17 @@
"alias" : "net_usage"
, "query" : "fnu.sql"
, "fields" : {
"dim:contact_date" : "date",
"dim:contactDate" : "date",
"dim:point" : "integer",
"dim:mac_addr" : "string",
"met:avg_download" : "integer",
"met:avg_upload" : "integer",
"met:count_countact" : "integer",
"met:last_contact" : "date",
"met:max_upload" : "integer",
"met:max_download" : "integer",
"met:sum_download" : "integer",
"met:sum_upload" : "integer"
"dim:macAddr" : "string",
"met:avg:download" : "integer",
"met:avg:upload" : "integer",
"met:count:contact" : "integer",
"met:max:contact" : "date",
"met:max:download" : "integer",
"met:max:upload" : "integer",
"met:sum:download" : "integer",
"met:sum:upload" : "integer"
}
}
, {
......@@ -21,10 +21,10 @@
, "query" : "city.sql"
, "fields" : {
"dim:city" : "integer",
"dim:city_name" : "string",
"dim:cityName" : "string",
"dim:region" : "string",
"dim:state" : "string",
"met:count_city" : "integer"
"met:count:city" : "integer"
}
}
, {
......@@ -33,16 +33,16 @@
, "fields" : {
"dim:active" : "boolean",
"dim:city" : "integer",
"dim:digital_city" : "boolean",
"dim:digitalCity" : "boolean",
"dim:gesac" : "boolean",
"dim:point" : "integer",
"dim:point_date" : "date",
"dim:point_name" : "string",
"dim:pointDate" : "date",
"dim:pointName" : "string",
"dim:project" : "string",
"dim:telecenter" : "boolean",
"met:count_point" : "integer",
"met:hired_download" : "integer",
"met:hired_upload" : "integer"
"met:count:point" : "integer",
"met:avg:hiredDownload" : "integer",
"met:avg:hiredUpload" : "integer"
}
}
, {
......@@ -50,28 +50,28 @@
, "query" : "inv_changes.sql"
, "fields" : {
"dim:disk" : "integer",
"dim:inventory_date" : "date",
"dim:mac_addr" : "string",
"dim:inventoryDate" : "date",
"dim:macAddr" : "string",
"dim:memory" : "string",
"dim:old_disk" : "string",
"dim:old_inventory_date" : "date",
"dim:old_memory" : "string",
"dim:old_os" : "string",
"dim:old_processor" : "string",
"dim:oldDisk" : "string",
"dim:oldInventoryDate" : "date",
"dim:oldMemory" : "string",
"dim:oldOs" : "string",
"dim:oldProcessor" : "string",
"dim:os" : "string",
"dim:point" : "integer",
"dim:processor" : "string",
"met:machines" : "integer",
"met:modified_disk" : "integer",
"met:modified_memory" : "integer"
"met:count:machines" : "integer",
"met:count:modified_disk" : "integer",
"met:count:modified_memory" : "integer"
}
}
, {
"alias" : "inventory"
, "query" : "inv.sql"
, "fields" : {
"dim:current_inventory" : "boolean",
"dim:inventory_date" : "date",
"dim:currentInventory" : "boolean",
"dim:inventoryDate" : "date",
"dim:point" : "integer"
}
}
......
......@@ -3,7 +3,7 @@ SELECT
, name AS "dim:city_name"
, region AS "dim:region"
, state AS "dim:state"
, id AS "met:count_city"
, id AS "met:count:city"
FROM
city
;
SELECT
contact_date AS "dim:contact_date"
contact_date AS "dim:contactDate"
, id_point AS "dim:point"
, macaddr AS "dim:mac_addr"
, down_bytes AS "met:avg_download"
, up_bytes AS "met:avg_upload"
, '1' AS "met:count_countact"
, contact_date AS "met:last_contact"
, down_bytes AS "met:max_upload"
, up_bytes AS "met:max_download"
, down_bytes AS "met:sum_download"
, up_bytes AS "met:sum_upload"
, macaddr AS "dim:macAddr"
, down_bytes AS "met:avg:download"
, up_bytes AS "met:avg:upload"
, '1'::INTEGER AS "met:count:countact"
, contact_date AS "met:max:contact"
, down_bytes AS "met:max:upload"
, up_bytes AS "met:max:download"
, down_bytes AS "met:sum:download"
, up_bytes AS "met:sum:upload"
FROM
fact_net_usage
;
SELECT
is_current AS "dim:current_inventory"
, load_date AS "dim:inventory_date"
is_current AS "dim:currentInventory"
, load_date AS "dim:inventoryDate"
, id_point AS "dim:point"
FROM
dim_inventory
......
SELECT
d.new_hd_size AS "dim:disk"
, d.new_date AS "dim:inventory_date"
, d.machine AS "dim:mac_addr"
, d.new_date AS "dim:inventoryDate"
, d.machine AS "dim:macAddr"
, d.new_memory_size AS "dim:memory"
, d.old_hd_size AS "dim:old_disk"
, d.old_date AS "dim:old_inventory_date"
, d.old_memory_size AS"dim:old_memory"
, d.old_hd_size AS "dim:oldDisk"
, d.old_date AS "dim:oldInventoryDate"
, d.old_memory_size AS"dim:oldMemory"
, d.os_distro AS "dim:os"
, d.id_point AS "dim:point"
, d.processor AS "dim:processor"
, '1' AS "met:machines"
, d.hd_alert AS "met:modified_disk"
, d.memory_alert AS "met:modified_memory"
, '1'::INTEGER AS "met:count:machines"
, d.hd_alert AS "met:modifiedDisk"
, d.memory_alert AS "met:modifiedMemory"
FROM
(
SELECT
......
SELECT
p.is_active AS "dim:active"
, p.id_city AS "dim:city"
, p.is_digital_city AS "dim:digital_city"
, p.is_digital_city AS "dim:digitalCity"
, p.is_gesac AS "dim:gesac"
, p.id AS"dim:point"
, current_date AS "dim:point_date"
, a.establishment AS "dim:point_name"
, current_date AS "dim:pointDate"
, a.establishment AS "dim:pointName"
, CASE
WHEN (p.is_digital_city = TRUE) THEN 'DC'
WHEN (p.is_telecenter = TRUE AND p.is_gesac = FALSE) THEN 'TLBR'
......@@ -13,9 +13,9 @@ SELECT
ELSE 'GESAC'
END AS"dim:project"
, p.is_telecenter AS "dim:telecenter"
, '1' AS "met:count_point"
, h.hired_download AS "met:hired_download"
, h.hired_upload AS "met:hired_upload"
, '1'::INTEGER AS "met:count:point"
, h.hired_download AS "met:avg:hiredDownload"
, h.hired_upload AS "met:avg:hiredUpload"
FROM
point p
INNER JOIN address a ON p.id = a.id_point
......
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