google bigquery - Same exactly Query Fails or "Succeeds" with different Aliases used -
below 2 versions of same query
version 1 (uses k alias in inner select):
select k [year], w_vol, row_number() on (order k desc) rank1, row_number() on (order w_vol desc) rank2 ( select w_vol, c_date k (select 1590 c_date, 1 w_vol), (select 1599 c_date, 1 w_vol), (select 1602 c_date, 1 w_vol), (select 1609 c_date, 2 w_vol), (select 1610 c_date, 1 w_vol), ) order 1
version 2 (uses l alias in inner select):
select l [year], w_vol, row_number() on (order l desc) rank1, row_number() on (order w_vol desc) rank2 ( select w_vol, c_date l (select 1590 c_date, 1 w_vol), (select 1599 c_date, 1 w_vol), (select 1602 c_date, 1 w_vol), (select 1609 c_date, 2 w_vol), (select 1610 c_date, 1 w_vol), ) order 1
below output consistently getting both queries (note no cached results
used)
i expected result same no matter alias used - alias @ all!
question: why consistently getting failure version 1 , "success" version 2?
this rather interesting bug, news fixed in bigquery's standard sql. details how try out - check https://cloud.google.com/bigquery/sql-reference/enabling-standard-sql
Comments
Post a Comment