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:
Ning Sun
2026-01-26 17:53:45 +08:00
committed by GitHub
parent 085e9dfc7b
commit 079ee8615f
6 changed files with 690 additions and 226 deletions

View File

@@ -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 --