Is the "counter" accurate with the new standard SQL BigQuery syntax?

Using the obsolete BigQuery syntax, we must use the exact_count_distinct function if we want to have the exact number of different values ​​for the field.

With the standard SQL 2011 syntax , it is interesting whether the “ count (excellent myfield)” will always return the exact number of different values ​​if I do not select the option “Use legacy SQL”.

+2
source share
2 answers

COUNT(DISTINCT input) gives the exact amount in standard SQL.

, COUNT(DISTINCT input) , EXACT_COUNT_DISTINCT(input) BigQuery SQL, , .

SQL .

+6

APPROX_COUNT_DISTINCT ( ):

COUNT(DISTINCT input) -
APPROX_COUNT_DISTINCT(input) -

+7

Source: https://habr.com/ru/post/1665927/


All Articles