Skip to content

Commit

Permalink
Add schema mapping for statvar-obs table and rollout it in BigQuery (#…
Browse files Browse the repository at this point in the history
…373)

* Add schema mapping for statvar-obs table and rollout it in BigQuery

* update observedNodeLocation
  • Loading branch information
shifucun authored Dec 3, 2020
1 parent 4d95409 commit dd2b221
Show file tree
Hide file tree
Showing 9 changed files with 1,041 additions and 796 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,13 @@ docs/_build/

# Downloaded tools, e.g. golangci-lint
bin/

# GCP
mixer-robot-key.json

# Kubenetes
*/minikube/deployment.yaml
*/minikube/endpoints.yaml

# ESP
mixer-grpc.pb
2 changes: 1 addition & 1 deletion deployment/bigquery.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google.com:datcom-store-dev.dc_kg_2020_11_22_01_01_40
google.com:datcom-store-dev.dc_kg_2020_12_02_14_38_23
12 changes: 12 additions & 0 deletions e2etest/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ func TestQuery(t *testing.T) {
}`,
"name.json",
},
{
`SELECT ?observation ?place
WHERE {
?observation typeOf Observation .
?observation statisticalVariable Amount_EconomicActivity_GrossNationalIncome_PurchasingPowerParity_PerCapita .
?observation observedNodeLocation ?place .
?place typeOf Country .
}
ORDER BY ASC (?place)
LIMIT 10`,
"statvar-obs.json",
},
} {
req := &pb.QueryRequest{Sparql: c.sparql}
resp, err := client.Query(ctx, req)
Expand Down
108 changes: 108 additions & 0 deletions golden_response/staging/query/statvar-obs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"header": [
"?observation",
"?place"
],
"rows": [
{
"cells": [
{
"value": "dc/o/pgym0z20p7v05"
},
{
"value": "country/ABW"
}
]
},
{
"cells": [
{
"value": "dc/o/vjv17yc2zq21b"
},
{
"value": "country/ABW"
}
]
},
{
"cells": [
{
"value": "dc/o/q86f2x7n069w7"
},
{
"value": "country/ABW"
}
]
},
{
"cells": [
{
"value": "dc/o/9l577dgl0h157"
},
{
"value": "country/ABW"
}
]
},
{
"cells": [
{
"value": "dc/o/5h86g14fj2fr8"
},
{
"value": "country/ABW"
}
]
},
{
"cells": [
{
"value": "dc/o/qlj8n58zk9ll4"
},
{
"value": "country/ABW"
}
]
},
{
"cells": [
{
"value": "dc/o/6vptjvx9td8zf"
},
{
"value": "country/ABW"
}
]
},
{
"cells": [
{
"value": "dc/o/srfs77qhtngb3"
},
{
"value": "country/ABW"
}
]
},
{
"cells": [
{
"value": "dc/o/kg6pryqvbgd78"
},
{
"value": "country/ABW"
}
]
},
{
"cells": [
{
"value": "dc/o/lxgzljcplhdr4"
},
{
"value": "country/ABW"
}
]
}
]
}
2 changes: 1 addition & 1 deletion golden_response/staging/query/weather1.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"cells": [
{
"value": "-2.934417973281199"
"value": "-2.9344179732811995"
}
]
}
Expand Down
Loading

0 comments on commit dd2b221

Please sign in to comment.