-
Notifications
You must be signed in to change notification settings - Fork 222
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
Snowflake Semi Structured Data incompatibility #965
Comments
Thanks for the issue @sercandogan Generally we'd use an s-string for features that PRQL doesn't yet support, like: from sometable
filter s"json:first_key.second_key" == 1 and s"json:third_key" == 50 Unfortunately this specific case is more difficult — because SELECT
sometable.*
FROM
sometable
WHERE
json :first_key.second_key = 1
AND json :third_key = 50 Note the space in We've had this issue a couple of times around s-strings. Ideally we could not format the SQL inside s-strings, but we'd need to think of how to do this — maybe we pass a string with a sentinel and then replace it after the formatting. (We do want to do some formatting, because otherwise it's a very long line, and producing interpretable SQL is a core principle) |
Non-ideal but we used to have a similar issue and we worked around it by just always running a regex replacement to remove these spaces automatically straight after compilation to SQL: |
I opened #1284 to address the broader issue around formatting, which subsumes this issue, so I'll close this. |
(in case anyone returns to this issue, the updated query above is from sometable
filter s"json:first_key.second_key" == 1 && s"json:first_key.second_key" == 1 ...which complies to... SELECT
*
FROM
sometable
WHERE
json :first_key.second_key = 1
AND json :first_key.second_key = 1
-- Generated by PRQL compiler version:0.13.0 (https://prql-lang.org) ...and shouldn't insert a space in |
Hey 🙌🏽,
Snowflake supports semi-structured data as variant type and you can access the item by using colon and dot.
Please see: https://docs.snowflake.com/en/user-guide/querying-semistructured.html#traversing-semi-structured-data
Example below fails with unexpected argument named:
I see also
:
used for named args & parameters. How can we support this syntax?The text was updated successfully, but these errors were encountered: