addding expected results
This commit is contained in:
parent
6ee0b99bd4
commit
9a398530b3
2984
src/pg/test/expected/02_load_tables_test.out
Normal file
2984
src/pg/test/expected/02_load_tables_test.out
Normal file
File diff suppressed because it is too large
Load Diff
79
src/pg/test/expected/40_observatory_utility_test.out
Normal file
79
src/pg/test/expected/40_observatory_utility_test.out
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
SELECT set_config(
|
||||||
|
'search_path',
|
||||||
|
current_setting('search_path') || ',cdb_observatory',
|
||||||
|
false
|
||||||
|
) WHERE current_setting('search_path') !~ '(^|,)cdb_observatory(,|$)';
|
||||||
|
set_config
|
||||||
|
------------------------------------------
|
||||||
|
"$user", public, cartodb,cdb_observatory
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
-- OBS_GeomTable
|
||||||
|
-- get table with known geometry_id
|
||||||
|
-- should give back a table like obs_{hex hash}
|
||||||
|
SELECT
|
||||||
|
cdb_observatory.OBS_GeomTable(
|
||||||
|
CDB_LatLng(40.7128,-74.0059),
|
||||||
|
'"us.census.tiger".census_tract'
|
||||||
|
);
|
||||||
|
obs_geomtable
|
||||||
|
----------------------------------------------
|
||||||
|
obs_a92e1111ad3177676471d66bb8036e6d057f271b
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
-- get null for unknown geometry_id
|
||||||
|
-- should give back null
|
||||||
|
SELECT
|
||||||
|
cdb_observatory.OBS_GeomTable(
|
||||||
|
CDB_LatLng(40.7128,-74.0059),
|
||||||
|
'"us.census.tiger".nonexistant_id'
|
||||||
|
);
|
||||||
|
obs_geomtable
|
||||||
|
---------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
-- OBS_GetColumnData
|
||||||
|
-- should give back:
|
||||||
|
-- colname | tablename | aggregate
|
||||||
|
-- -----------|-----------------|-----------
|
||||||
|
-- geoid | obs_{hex table} | null
|
||||||
|
-- total_pop | obs_{hex table} | sum
|
||||||
|
SELECT
|
||||||
|
(unnest(cdb_observatory.OBS_GetColumnData(
|
||||||
|
'"us.census.tiger".census_tract',
|
||||||
|
Array['"us.census.tiger".census_tract_geoid', '"us.census.acs".B01001001'],
|
||||||
|
'2009 - 2013'
|
||||||
|
))).*
|
||||||
|
ORDER BY 1 ASC;
|
||||||
|
colname | tablename | aggregate
|
||||||
|
-----------+----------------------------------------------+-----------
|
||||||
|
geoid | obs_11ee8b82c877c073438bc935a91d3dfccef875d1 |
|
||||||
|
geoid | obs_65f29658e096ca1485bf683f65fdbc9f05ec3c5d |
|
||||||
|
geoid | obs_ab038198aaab3f3cb055758638ee4de28ad70146 |
|
||||||
|
geoid | obs_d34555209878e8c4b37cf0b2b3d072ff129ec470 |
|
||||||
|
total_pop | obs_ab038198aaab3f3cb055758638ee4de28ad70146 | sum
|
||||||
|
(5 rows)
|
||||||
|
|
||||||
|
-- OBS_LookupCensusHuman
|
||||||
|
-- should give back: {"\"us.census.acs\".B19083001"}
|
||||||
|
SELECT
|
||||||
|
cdb_observatory.OBS_LookupCensusHuman(
|
||||||
|
Array['gini_index']
|
||||||
|
);
|
||||||
|
obs_lookupcensushuman
|
||||||
|
---------------------------------
|
||||||
|
{"\"us.census.acs\".B19083001"}
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
-- OBS_BuildSnapshotQuery
|
||||||
|
-- Should give back: SELECT vals[1] As total_pop, vals[2] As male_pop, vals[3] As female_pop, vals[4] As median_age
|
||||||
|
SELECT
|
||||||
|
cdb_observatory.OBS_BuildSnapshotQuery(
|
||||||
|
Array['total_pop','male_pop','female_pop','median_age']
|
||||||
|
);
|
||||||
|
obs_buildsnapshotquery
|
||||||
|
-------------------------------------------------------------------------------------------------
|
||||||
|
SELECT vals[1] As total_pop, vals[2] As male_pop, vals[3] As female_pop, vals[4] As median_age
|
||||||
|
(1 row)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user