Skip to content
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

fix(ingest/bigquery): quoting for APPROX_COUNT_DISTINCT in BigQuery #7207

Merged
merged 3 commits into from
Feb 1, 2023

Conversation

mryorik
Copy link
Contributor

@mryorik mryorik commented Feb 1, 2023

Quoting a column name with doublequote here produces wrong results because it's equal to calling APPROX_COUNT_DISTINCT on a string constant. Column names should be quoted with the backtick character, see https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#quoted_identifiers.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

Quoting a column name with doublequote here produces wrong results because it's equal to calling `APPROX_COUNT_DISTINCT` on a string constant.
Column names should be quoted with the backtick character, see https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#quoted_identifiers.
@mryorik mryorik changed the title fix: quoting for APPROX_COUNT_DISTINCT in BigQuery fix(ingest/bigquery): quoting for APPROX_COUNT_DISTINCT in BigQuery Feb 1, 2023
@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Feb 1, 2023
@anshbansal anshbansal added the community-contribution PR or Issue raised by member(s) of DataHub Community label Feb 1, 2023
Copy link
Collaborator

@mayurinehate mayurinehate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

Copy link
Contributor

@treff7es treff7es left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for the contribution

@treff7es treff7es merged commit a2e0c60 into datahub-project:master Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution PR or Issue raised by member(s) of DataHub Community ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants