Skip to content
Snippets Groups Projects
Commit 562d002f authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira
Browse files

Merge branch 'issue/26' into 'master'

Issue #26: Fix name pattern

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