Optimize Function does not seem to deal with ORDER BY in CTEs #3210
Replies: 1 comment 1 reply
-
Hey @rorynormaness, thanks for trying out the optimizer and reporting these problems. Can you just file an issue for this and any other bug you find? Thanks! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello guys - me again.
I seem to be encountering strange behaviour of the optimize function on BigQuery SQL, when there is an ORDER BY clause within a CTE, which results in invalid SQL output.
Let's take the following as an example to be optimized:
Then when I put this through the optimize function as follows:
I get the following:
I know it would be a judgment call on whether to put it at the end or not at all, but for what it's worth, I would make the case that it should be omitted altogether in the optimizer rules because:
Beta Was this translation helpful? Give feedback.
All reactions