8000 Looker doesn't `group by` in certain cases when primary key is present in query · Issue #669 · spectacles-ci/spectacles · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Looker doesn't group by in certain cases when primary key is present in query #669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DylanBaker opened this issue Dec 2, 2022 · 0 comments
Labels
Bug Something isn't working Validator: SQL

Comments

@DylanBaker
Copy link
Collaborator

From the Looker docs:

Looker also avoids unnecessary GROUP BY clauses in some cases. If one of the dimensions in your query has been defined as the primary key (by using the primary_key parameter) of the Explore you're using, the GROUP BY clause will be dropped.

This behaviour is normally totally fine (and actually speeds up our queries on Snowflake) but if you have a dimension that points to a BigQuery array column, this will actually miss an error which tells you that you can't group by array fields, which would come up in normal use of Looker if the dimension is not hidden. This means that a Spectacles run might show an explore as passing, even though one of these array dimensions could error in normal use.

I believe there are two actions here:

  1. We should confirm with Looker what the exact criteria are for the group by field being excluded from a query as the docs as a bit light here.
  2. We should probably change Spectacles to run primary key dimensions alone, so that it doesn't have this impact on the queries. It's not clear yet if this is all primary keys in the query or just the primary key from the top-level view of the explore. This should be clarified with Looker in (1).

cc: @ian-thompson-king

@DylanBaker DylanBaker added Bug Something isn't working Validator: SQL labels Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Validator: SQL
Projects
None yet
Development

No branches or pull requests

1 participant
0