mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-19 14:30:43 +00:00
feat: UDF json_get with user specified return type (#7554)
* feat: add return_field_from_args * feat: add JsonGetWithType * port json_get_float and json_get_bool to new implementation, add json_get with third argument accepting a scalar value for type. * fix: lint fix * chore: add sqlness tests * chore: update tests
This commit is contained in:
@@ -73,6 +73,18 @@ SELECT json_get_int(json_get_object(j, '[0]'), 'a.i') FROM jsons;
|
||||
|
||||
SELECT json_get_int(json_get_object(j, '[9]'), 'a.i') FROM jsons;
|
||||
|
||||
SELECT json_get(j, '[0]', 'int') FROM jsons;
|
||||
|
||||
SELECT json_get(j, '[0]', 'float') FROM jsons;
|
||||
|
||||
SELECT json_get(j, '[1]', 'int') FROM jsons;
|
||||
|
||||
SELECT json_get(j, '[1]', 'float') FROM jsons;
|
||||
|
||||
SELECT json_get(j, '[2]', 'bool') FROM jsons;
|
||||
|
||||
SELECT json_get(j, '[3]', 'string') FROM jsons;
|
||||
|
||||
DROP TABLE jsons;
|
||||
|
||||
-- test functions in WHERE clause --
|
||||
|
||||
Reference in New Issue
Block a user