google-code-export / google-bigquery

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

"EACH" keyword in "GROUP EACH BY" no longer performing as desired #195

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Ran a query with a calculated Aggregate field with "GROUP EACH BY"
2. Ran same query with "GROUP BY" instead

What is the expected output? What do you see instead?
- The first query produced "0" as a result, whereas the second query produced 
the correct number

What version of the product are you using? On what operating system?
- Using the most current version of Big Query.  I have tested in Chrome form 
MAC and Chrome for Windows 7

Please provide any additional information below.
- In the past, The GROUP EACH BY keywords acted as desired and returned the 
correct results.  Only recently has this changed and our queries no longer 
function.
- The following are sample queries that I used to produce the results.  Also, I 
know, if you can do "Group By" without hitting resource limits, that it is 
preferred.  I had to pair these examples down from the larger queries with 
multiple fields that were being grouped by to get them to run for the examples:

-- Query that doesn't produce the correct result
select
  date(date) as date
    ,sum(case when hits.type = "page" then 1 else 0 end) as pageviews
    ,count(distinct (case when hits.type = "page" then concat(fullvisitorid, string(visitid), hits.page.pagepath) end), 1000000) as unique_pageviews

from
    table_date_range([XXXXXXXX.ga_sessions_], timestamp('2014-10-06'), timestamp('2014-10-06'))

group each by
    date

ignore case;

-- Query that does work:
select
  date(date) as date
    ,sum(case when hits.type = "page" then 1 else 0 end) as pageviews
    ,count(distinct (case when hits.type = "page" then concat(fullvisitorid, string(visitid), hits.page.pagepath) end), 1000000) as unique_pageviews

from
    table_date_range([XXXXXXXX.ga_sessions_], timestamp('2014-10-06'), timestamp('2014-10-06'))

group by
    date

ignore case;

Original issue reported on code.google.com by hog...@gmail.com on 1 Dec 2014 at 10:38

GoogleCodeExporter commented 9 years ago
Hello, what is your project id and/or a recent job id that exhibited this issue?

Original comment by thomasp...@google.com on 17 Dec 2014 at 5:45

GoogleCodeExporter commented 9 years ago
Thanks for taking a look.  The following it the JobID: 
ua-web-analytics:job_m_pWRZMl7hWzgeXmQBN5bY5uU48

Additionally, Someone has just responded to my Stack Overflow Post 
(http://stackoverflow.com/questions/27488525/each-keyword-isnt-returning-correct
-result-in-group-each-by) with some additional research.

Thanks.

Original comment by hog...@gmail.com on 17 Dec 2014 at 6:08

GoogleCodeExporter commented 9 years ago
Update: This bug has been fixed and will be deployed to production in the next 
week or two.

Original comment by jcon...@google.com on 2 Jan 2015 at 8:37

GoogleCodeExporter commented 9 years ago
We rolled out a change earlier this month that we thought would fix the issue, 
but it seems to not have had the desired effect.  We'll investigate more and 
fix the issue for good.

Original comment by dk...@google.com on 23 Jan 2015 at 8:04