2012-11-04 28 views
0

我有一個問題,這個查詢:BigQuery - JOIN左側的UNION ==意外。請重試

select 
sviEventoviFull.site_sectionid as site_sectionid, 
sviEventoviFull.ev_date as ev_date, 
sum(sviEventoviFull.total_views) as actualTotalViews, 
sum(sviEventoviFull.total_visits) as actualTotalVisits, 
sum(sviEventoviFull.total_time) as actualTotalTime, 
sum(sviEventoviFull.realUserCount) as actualRealUserCount from 
(select userid,site_sectionid, 
    ev_date, 
    total_views, 
    total_visits, 
    total_time, 
    1 as realUserCount from 
    DotMetric_TEST.EV_03112012, 
    DotMetric_TEST.EV_04112012) 

as sviEventoviFull 

join 
    (
    select userid from DotMetric_TEST.UserSettings where 
    q1=100 
    and 
    q2=213 
    and 
    geo_code in (7,6,1,2) 
    ) 
    as patternTablica 
    on sviEventoviFull.userid =patternTablica.userid 
    where sviEventoviFull.site_sectionid in (1,2,3,4,5,6,7,8,11,123) 
    group by site_sectionid,ev_date 

它不斷告訴我「錯誤:意外,請重試。」

沒有UNION相同的查詢按預期工作:

select 
sviEventoviFull.site_sectionid as site_sectionid, 
sviEventoviFull.ev_date as ev_date, 
sum(sviEventoviFull.total_views) as actualTotalViews, 
sum(sviEventoviFull.total_visits) as actualTotalVisits, 
sum(sviEventoviFull.total_time) as actualTotalTime, 
sum(sviEventoviFull.realUserCount) as actualRealUserCount from 
(select userid,site_sectionid, 
    ev_date, 
    total_views, 
    total_visits, 
    total_time, 
    1 as realUserCount from 
    DotMetric_TEST.EV_03112012) 

as sviEventoviFull 

join 
    (
    select userid from DotMetric_TEST.UserSettings where 
    q1=100 
    and 
    q2=213 
    and 
    geo_code in (7,6,1,2) 
    ) 
    as patternTablica 
    on sviEventoviFull.userid =patternTablica.userid 
    where sviEventoviFull.site_sectionid in (1,2,3,4,5,6,7,8,11,123) 
    group by site_sectionid,ev_date 

請幫助我們這個,以及如何使用UNION和JOIN在一起。加入左側的聯盟應該是非常普遍的要求!

+0

我在這種情況下想出瞭解決方法。如果我只是把這個連接放在'IN(SUBQUERY ...)'子句中,它按預期工作。 –

回答

1

這是一個已知的錯誤,我們正在修復。修補程序發佈後,我會更新此線程。

+0

這有什麼更新? –

+0

一個半月過去了,沒有什麼關於這個...... –

+0

這是內部修復的,它會在我們下次更新查詢引擎時發佈,但是由於公司整個假期的產量凍結,我們一直被阻止。我的猜測是,除非我們找到迴歸,否則它會在下週出現。 –