BigQuery query doesn't work inside a view -


when select view i've created receive following error time time, not always:

query: timestamp evaluation: connection error. (error code: invalidquery) job id  vex-custom:bquijob_59705b02_155966ddc5f start time  jun 28, 2016, 11:53:50 end time    jun 28, 2016, 11:53:50 

running query works well.

there's 2 two special things query:

  1. it uses table_date_range
  2. it references tables project view resides. we've done lot of times without issues

can google perhaps check job id?

i checked internal details query. view failed query references makes few problematic calls timestamp functions. here's 1 example:

select * table_date_range([...], timestamp(date_add(utc_usec_to_day(current_date()), -15, "day")), current_timestamp()) 

specifically, call timestamp(date_add(utc_usec_to_day(current_date()), -15, "day")) erroring because:

  1. utc_usec_to_day returns integer, not timestamp.
  2. date_add expects argument of type timestamp.

you can wrap call utc_usec_to_day usec_to_timestamp convert argument type timestamp, so: timestamp(date_add(usec_to_timestamp(utc_usec_to_day(current_date())), -15, "day"))

we're in process of rolling out release more closely checks expected input types of many timestamp functions, why seeing inconsistent behavior. these fixes prevent issues functions can return malformatted timestamps, , brings our behavior more in line our documentation on timestamp functions.


separately, need work on making sure errors occur within evaluation of timestamps table_date_range return more useful errors "connection error".


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -