Conversation
sql/pg_duckdb--0.2.0--0.3.0.sql
Outdated
| COMMENT ON DOMAIN pg_catalog.blob IS 'The DuckDB BLOB alias for BYTEA'; | ||
|
|
||
| -- json_exists | ||
| CREATE FUNCTION @extschema@.json_exists(json VARCHAR , path VARCHAR) |
There was a problem hiding this comment.
It seems confusing that these functions expect a VARCHAR type for the json argument. I'd expect that argument to be of the json or jsonb (or have functions for both of them).
There was a problem hiding this comment.
Just added for json
src/pgduckdb_metadata_cache.cpp
Outdated
| "iceberg_snapshots", "delta_scan", "read_json", "approx_count_distinct"}; | ||
| const char *function_names[] = {"read_parquet", "read_csv", "iceberg_scan", "iceberg_metadata", | ||
| "iceberg_snapshots", "delta_scan", "read_json", "approx_count_distinct", | ||
| "json_exists", "json_extract", "json_extract_string"}; |
There was a problem hiding this comment.
It seems this list is missing a bunch of the functions that you added.
| @@ -0,0 +1,144 @@ | |||
| -- <JSON_EXISTS> | |||
| -- Test 1: Path exists in a simple JSON object | |||
| SELECT json_exists('{"a": {"b": 1}}', '$.a.b'); -- Expected: true | |||
There was a problem hiding this comment.
I think most of these tests simply test that DuckDB works correctly, not so much the pg_duckdb intgration.
I think for each function it should give us enough confidence into pg_duckdb to add one test with reasonable arguments, and then tests with the various combinations of NULL arguments. So while I really appreciate the effort to add extensive tests, I don't think they add much value and would in practice only increase test runtime.
There was a problem hiding this comment.
Reduced the tests
|
@JelteF structures are not supported as types in pg_duckdb so not possible to implement functions like: Added all the other ones |
|
Curious why this fails on postgres 17 |
sql/pg_duckdb--0.2.0--0.3.0.sql
Outdated
There was a problem hiding this comment.
I just merged #531. Which introduces a more re-usable way of doing this:
AS 'MODULE_PATHNAME', 'duckdb_only_function'
LANGUAGE C;8fd291f to
4daeed0
Compare
Addresses #516