user3443475
user3443475

Reputation: 33

google big query limit clause returning too many rows

In big query I am running a query on exported tables from GA.

I can not seem to get big query to limit the results. Here is a sample query, quite basic.

SELECT * FROM [1111111.ga_sessions_20140318] LIMIT 20000

The result set returns but with 7 million+ rows! I have tried this several different ways, ie. out to a table, just return result set, use cache results, don't use cached results, etc. No matter which table I try to query it always returns the entire table.

This is basically the same as the sample query big query gives when clicking on the query table button except I changed the limit value from 1000 to 20000.

Anyone have any insight?

Upvotes: 3

Views: 1664

Answers (1)

Felipe Hoffa
Felipe Hoffa

Reputation: 59325

As noted by the comment on the original question:

"Is it possible that the number of rows shown at the bottom of the result set returned in big query is my 20000 main object records plus all the nested records?"

The answer is yes: BigQuery will apply the limit to the number of rows in the response, but if there are nested records involved, those will be flattened in the output.

Upvotes: 1

Related Questions