Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LAX JSON functions not found #178

Open
joshbode opened this issue Dec 5, 2024 · 0 comments
Open

LAX JSON functions not found #178

joshbode opened this issue Dec 5, 2024 · 0 comments

Comments

@joshbode
Copy link

joshbode commented Dec 5, 2024

The LAX family of functions (LAX_INT64, LAX_STRING, LAX_BOOL, LAX_FLOAT64) are not recognised, showing a message like: INVALID_ARGUMENT: Function not found: LAX_STRING; Did you mean string?.

Additionally (happy to report as a separate issue) diagnostics are being generated for only the first error in the query, i.e. I can see the "error" for LAX_STRING but not for the subsequent unknown functions until I comment out the LAX_STRING line.
Diagnostics for separate queries (separated by ;) in the same file are still being generated, though.

Example query:

WITH
  x AS (
    SELECT
      PARSE_JSON(
        '{"id": 555, "flag": true, "value": 123.4, "message": "Hi kitagry"}'
      ) data
  )
SELECT
  LAX_STRING(JSON_QUERY(x.data, '$.message')) message,
  LAX_FLOAT64(JSON_QUERY(x.data, '$.value')) value,
  LAX_BOOL(JSON_QUERY(x.data, '$.flag')) flag,
  LAX_INT64(JSON_QUERY(x.data, '$.id')) id
FROM
  x;

Diagnostics in Neovim:

image

I'm running with the latest main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant