sijocherian / google-bigquery

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

Add support for parameters in view / functions that return data #164

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Broader context: 
http://stackoverflow.com/questions/26217851/view-with-parameters-in-bigquery

Example of use:

CREATE data_view(TIMESTAMP date_param) AS
SELECT data.* FROM 
  data_table data
  JOIN EACH
  (  SELECT id, max(event_date) max_event_date FROM
       data_table
     WHERE 
        event_date <= $date_param
     GROUP BY id) max_data
   ON data.id = s.id AND data.event_date = s.max_event_date;

and use it as:
select * from data_view('2014-10-04 12:00:00');

It might be even more useful, if we can use it with table wildcard functions 
(e.g. TABLE_DATE_RANGE ).

Original issue reported on code.google.com by r.plaszo...@ocado.com on 7 Oct 2014 at 5:56

GoogleCodeExporter commented 9 years ago
(Last part is already in the tracker: 
https://code.google.com/p/google-bigquery/issues/detail?id=96 )

Original comment by r.plaszo...@ocado.com on 7 Oct 2014 at 6:00

GoogleCodeExporter commented 9 years ago
Thank you for your feature request. We are looking into it and will update the 
bug when we have more information.

Original comment by ma...@google.com on 19 Dec 2014 at 10:11