From 24a736c72ed325981bd649470dc96305a7d3c1c9 Mon Sep 17 00:00:00 2001 From: Mario de Frutos Date: Thu, 29 Jun 2017 13:33:07 +0200 Subject: [PATCH] Tests for the PR #298 --- .../expected/41_observatory_augmentation_test.out | 3 +++ src/pg/test/sql/41_observatory_augmentation_test.sql | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/pg/test/expected/41_observatory_augmentation_test.out b/src/pg/test/expected/41_observatory_augmentation_test.out index 5c7bced..a08f8ae 100644 --- a/src/pg/test/expected/41_observatory_augmentation_test.out +++ b/src/pg/test/expected/41_observatory_augmentation_test.out @@ -210,6 +210,9 @@ t|t|t id|data_polygon_measure_one_null|data_polygon_measure_two_null t|t|t (1 row) +id|data_polygon_measure_one_null|data_polygon_measure_two_null +t|t|t +(1 row) id|data_polygon_measure_one_predenom|data_polygon_measure_two_predenom t|t|t (1 row) diff --git a/src/pg/test/sql/41_observatory_augmentation_test.sql b/src/pg/test/sql/41_observatory_augmentation_test.sql index 18ffe99..39ad22e 100644 --- a/src/pg/test/sql/41_observatory_augmentation_test.sql +++ b/src/pg/test/sql/41_observatory_augmentation_test.sql @@ -596,6 +596,18 @@ SELECT id = 1 id, abs((data->1->>'value')::Numeric - 0.4902) / 0.4902 < 0.001 data_polygon_measure_two_null FROM data; +-- OBS_GetData/OBS_GetMeta by geom with two measures and one return null +WITH +meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(), + '[{"numer_id": "us.census.acs.B19013001_quantile"}, {"numer_id": "us.census.acs.B01001002"}]') meta), +data AS (SELECT * FROM cdb_observatory.OBS_GetData( + ARRAY[(cdb_observatory._TestArea(), 1)::geomval], + (SELECT meta FROM meta))) +SELECT id = 1 id, + (data->0->>'value') is NULL data_polygon_measure_one_null, + abs((data->1->>'value')::Numeric - 0.4902) / 0.4902 < 0.001 data_polygon_measure_two_null +FROM data; + -- OBS_GetData/OBS_GetMeta by geom with two standard measures predenom normalization WITH meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),