-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
Description
This postgresql query
SELECT CAST(unanswered_count/question_count AS numeric) AS computed_pct, unanswered_pct
FROM stackoverflow
WHERE question_count != 0;generates a clean AST in the AST viewer.
However, the equivalent query (in postgresql, at least)
SELECT unanswered_count/question_count::numeric AS computed_pct, unanswered_pct
FROM stackoverflow
WHERE question_count != 0;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

