Files
greptimedb/tests/cases/standalone/common/function/geo.sql
Ning Sun e476e36647 feat: add geohash and h3 as built-in functions (#4656)
* feat: add built-in functions h3 and geohash

* tests: add sqlness tests for geo functions

* doc: correct h3 comment

* fix: lint error

* fix: toml format

* refactor: address review comments

* test: add more sqlness cases

* Apply suggestions from code review

Co-authored-by: Ruihang Xia <waynestxia@gmail.com>

---------

Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
2024-09-05 04:42:29 +00:00

52 lines
1.1 KiB
SQL

SELECT h3(37.76938, -122.3889, 0);
SELECT h3(37.76938, -122.3889, 1);
SELECT h3(37.76938, -122.3889, 8);
SELECT h3(37.76938, -122.3889, 100);
SELECT h3(37.76938, -122.3889, -1);
SELECT h3(37.76938, -122.3889, 8::Int8);
SELECT h3(37.76938, -122.3889, 8::Int16);
SELECT h3(37.76938, -122.3889, 8::Int32);
SELECT h3(37.76938, -122.3889, 8::Int64);
SELECT h3(37.76938, -122.3889, 8::UInt8);
SELECT h3(37.76938, -122.3889, 8::UInt16);
SELECT h3(37.76938, -122.3889, 8::UInt32);
SELECT h3(37.76938, -122.3889, 8::UInt64);
SELECT geohash(37.76938, -122.3889, 9);
SELECT geohash(37.76938, -122.3889, 10);
SELECT geohash(37.76938, -122.3889, 11);
SELECT geohash(37.76938, -122.3889, 100);
SELECT geohash(37.76938, -122.3889, -1);
SELECT geohash(37.76938, -122.3889, 11::Int8);
SELECT geohash(37.76938, -122.3889, 11::Int16);
SELECT geohash(37.76938, -122.3889, 11::Int32);
SELECT geohash(37.76938, -122.3889, 11::Int64);
SELECT geohash(37.76938, -122.3889, 11::UInt8);
SELECT geohash(37.76938, -122.3889, 11::UInt16);
SELECT geohash(37.76938, -122.3889, 11::UInt32);
SELECT geohash(37.76938, -122.3889, 11::UInt64);