From bd6019cc954937e191e434fb556c677be86e92b6 Mon Sep 17 00:00:00 2001 From: bharatnc Date: Sat, 8 Jan 2022 10:10:23 -0800 Subject: [PATCH] tests for h3CellAreaM2 --- .../02160_h3_cell_area_m2.reference | 16 ++++++++++ .../0_stateless/02160_h3_cell_area_m2.sql | 30 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 tests/queries/0_stateless/02160_h3_cell_area_m2.reference create mode 100644 tests/queries/0_stateless/02160_h3_cell_area_m2.sql diff --git a/tests/queries/0_stateless/02160_h3_cell_area_m2.reference b/tests/queries/0_stateless/02160_h3_cell_area_m2.reference new file mode 100644 index 00000000000..e8727e05cf9 --- /dev/null +++ b/tests/queries/0_stateless/02160_h3_cell_area_m2.reference @@ -0,0 +1,16 @@ +4106166334463.9233 +666617118882.2277 +85294486110.07852 +12781831077.715292 +1730585103.2965515 +302748289.6422262 +30296673.089799587 +4984621.68910725 +644257.1047199412 +113498.17901913072 +16692.536464980716 +2335.8824226249617 +324.4496823479308 +48.63220901355471 +7.442732649761864 +0.5977527784258132 diff --git a/tests/queries/0_stateless/02160_h3_cell_area_m2.sql b/tests/queries/0_stateless/02160_h3_cell_area_m2.sql new file mode 100644 index 00000000000..716219cdaab --- /dev/null +++ b/tests/queries/0_stateless/02160_h3_cell_area_m2.sql @@ -0,0 +1,30 @@ +-- Tags: no-fasttest + +DROP TABLE IF EXISTS h3_indexes; + +CREATE TABLE h3_indexes (h3_index UInt64) ENGINE = Memory; + +-- Random geo coordinates were generated using the H3 tool: https://github.com/ClickHouse-Extras/h3/blob/master/src/apps/testapps/mkRandGeo.c at various resolutions from 0 to 15. +-- Corresponding H3 index values were in turn generated with those geo coordinates using `geoToH3(lon, lat, res)` ClickHouse function for the following test. + +INSERT INTO h3_indexes VALUES (579205133326352383); +INSERT INTO h3_indexes VALUES (581263419093549055); +INSERT INTO h3_indexes VALUES (589753847883235327); +INSERT INTO h3_indexes VALUES (594082350283882495); +INSERT INTO h3_indexes VALUES (598372386957426687); +INSERT INTO h3_indexes VALUES (599542359671177215); +INSERT INTO h3_indexes VALUES (604296355086598143); +INSERT INTO h3_indexes VALUES (608785214872748031); +INSERT INTO h3_indexes VALUES (615732192485572607); +INSERT INTO h3_indexes VALUES (617056794467368959); +INSERT INTO h3_indexes VALUES (624586477873168383); +INSERT INTO h3_indexes VALUES (627882919484481535); +INSERT INTO h3_indexes VALUES (634600058503392255); +INSERT INTO h3_indexes VALUES (635544851677385791); +INSERT INTO h3_indexes VALUES (639763125756281263); +INSERT INTO h3_indexes VALUES (644178757620501158); + + +SELECT h3CellAreaM2(h3_index) FROM h3_indexes ORDER BY h3_index; + +DROP TABLE h3_indexes; \ No newline at end of file