evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in pure SQL and markdown
https://evidence.dev
MIT License
4.45k stars 214 forks source link

[Bug]: Scalar Function with name "->>" is not in the catalog #2267

Open jony1993 opened 3 months ago

jony1993 commented 3 months ago

Describe the bug

We have following sql in a markdown file. This reads from a postgresql source called production

SELECT 
    events.properties ->> 'organization_name' as organization_name,
    COUNT(DISTINCT events.user_id) as user_count
FROM 
    production.events events
GROUP BY 
    organization_name
ORDER BY 
    organization_name;

We then get following error: Catalog Error: Scalar Function with name "->>" is not in the catalog, but it exists in the json extension. Please try installing and loading the json extension by running: INSTALL json; LOAD json; Alternatively, consider enabling auto-install and auto-load by running: SET autoinstall_known_extensions=1; SET autoload_known_extensions=1;

Steps to Reproduce

  1. Add a sql source with a JSON column.
  2. Try to get a single property by using ->>

Logs

No response

System Info

No response

Severity

annoyance

Additional Information, or Workarounds

No response

archiewood commented 3 months ago

Loading DuckDB extensions are not currently supported in Evidence. JSON syntax is provided a DuckDB extension.

This should be unblocked when there is a new tagged version of DuckDB WASM released