runt18 / google-bigquery

Automatically exported from code.google.com/p/google-bigquery
0 stars 0 forks source link

query fails with window function and quoted reserved column name #279

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a table with 3 columns named: id, modified, following

2. Perform the following query: 
SELECT MAX(modified) OVER (PARTITION BY id), [following] FROM [dataset0.table]

3. Fails.  Removing the window function - works, aliasing the "following" 
column works.  Seems like there is a query-rewrite step which is incorrect.  
Preceding the window function with [following] reference also fails.

What is the expected output? What do you see instead?
Expected successful query execution, instead: 

---
Error: syntax error at: 1:74 expecting: EOF but got: "SELECT"

---

What version of the product are you using? On what operating system?
not relevant, this is the hosted bigquery instance in google

Please provide any additional information below.

Original issue reported on code.google.com by j...@usekahuna.com on 7 Jul 2015 at 6:55

GoogleCodeExporter commented 8 years ago
Hi, I've created a table with the schema described and am able to run the query 
given in step 2 successfully.

Could you please retry the query and reopen this issue if it's still broken for 
you?  It would be very helpful to include the job id for a failed run.

There have been a number of server side updates since this bug was filed, so 
hopefully it's fixed for your example as well.  My apologies on the latency in 
getting a reply to your issue; we are working on our oncall policy for 
supporting issues coming in on this site.

You can also reach out via Stack Overflow, which is very actively monitored by 
BigQuery engineers.  Just tag your issue "google-bigquery".  Thanks!

Original comment by thomasp...@google.com on 25 Nov 2015 at 11:50