Reputation: 67
BigQuery returns code 500: "Unexpected. Please try again."
Example query:
SELECT IF((bD >= "2013-03-18" AND bD < "2013-03-25"), "2013w12", IF((bD >= "2012-03-19" AND bD < "2012-03-26"), "2012w12", IF((bD >= "2011-03-21" AND bD < "2011-03-28"), "2011w12", ""))) AS pD_pW_T, IF((bD >= "2013-03-18" AND bD < "2013-03-25"), IF(bD > vD, null, (-(2013 - vY))), IF((bD >= "2012-03-19" AND bD < "2012-03-26"), IF(bD > vD, null, (-(2012 - vY))), IF((bD >= "2011-03-21" AND bD < "2011-03-28"), IF(bD > vD, null, (-(2011 - vY))), null))) AS aRD_y, IF((bD >= "2013-03-18" AND bD < "2013-03-25"), IF(bD > vD, null, (-(2013 - vY))), IF((bD >= "2012-03-19" AND bD < "2012-03-26"), IF(bD > vD, null, (-(2012 - vY))), IF((bD >= "2011-03-21" AND bD < "2011-03-28"), IF(bD > vD, null, (-(2011 - vY))), null))) AS aRD_y_name, STRING(SUM(ac)) AS acK_ac_0 FROM tabl.dataset_2009, tabl.dataset_2007, tabl.dataset_2008, tabl.dataset_2013, tabl.dataset_2012, tabl.dataset_2011, tabl.dataset_2010 WHERE (((bD >= "2013-03-18" AND bD < "2013-03-25") OR (bD >= "2012-03-19" AND bD < "2012-03-26") OR (bD >= "2011-03-21" AND bD < "2011-03-28"))) AND (((bD < "2013-03-27"))) AND (ac <> 0) GROUP BY pD_pW_T, aRD_y, aRD_y_name
The code that is in production has worked for weeks.
Reducing the amount of tables to perform a query on seems to work.
Upvotes: 0
Views: 135
Reputation: 7046
It looks like there's a schema mismatch on one of your tables: aRD_y has type integer in one table and boolean in another. If you try to union these tables together, you'll get an error.
I'll file a bug internally to improve this error message. Thanks for the report!
Upvotes: 1