-
Notifications
You must be signed in to change notification settings - Fork 8
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
SQL double-colon casting destroys AST topology #137
Comments
cc: @mona-kay |
Relevant instructor issue: https://github.com/datacamp/courses-sql-for-exploratory-data-analysis/issues/45 |
Apparently queries without a SELECT 999; |
Red nodes in the AST viewer (+ everything being on a single level) indicates that the parser doesn't understand the query. I will add this to our documentation. Both constructs ( |
As it turns out, WITH bins AS (
SELECT generate_series(0, 9, 1) AS lower,
generate_series(1, 10, 1) AS upper),
-- subset stackoverflow to just tag dropbox
dropbox AS (
SELECT question_count
FROM stackoverflow
WHERE tag='dropbox')
-- select lower, upper, and count(*)
SELECT lower, upper
-- from bins created above
FROM bins; |
It's not the |
Ah, that makes sense. Thanks for pointing out! |
cc: @sumedh10 |
I just discovered that SELECT count(*)
FROM evanston311
WHERE description ILIKE '%trash%'; Replacing |
@hermansje, all three problematic cases reported on this issue are resolved by
Once you deploy, this issue can be closed. Thanks a lot for the hard work! 💪 |
This
postgresql
querygenerates a clean AST in the AST viewer.
However, the equivalent query (in
postgresql
, at least)where the type casting is done with a double colon (
::
) wipes out the AST topology:A consequence of this is that the topologies of ASTs of queries containing double colons are also broken, subsequently breaking SCTs (for an example, go to Exercise 2.3 in this course).
For additional information, this is severely affecting SCTs for SQL for Exploratory Data Analysis, which purposefully uses this casting syntax throughout the course.
cc: @yashasroy
The text was updated successfully, but these errors were encountered: