Content-Length: 279184 | pFad | https://github.com/data-integrations/bigquery-delta-plugins/pull/274

17 PLUGIN-1833: fix: Use unique aliases in MERGE statements to avoid conflicts with column names by anshumanks · Pull Request #274 · data-integrations/bigquery-delta-plugins · GitHub
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

PLUGIN-1833: fix: Use unique aliases in MERGE statements to avoid conflicts with column names #274

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

anshumanks
Copy link
Contributor

@anshumanks anshumanks commented Feb 26, 2025

Use unique aliases in MERGE statements to avoid conflicts with column names

Jira : PLUGIN-1833

Description

This update resolves an issue where the MERGE operation was failing if the user's table contained columns A, B, or D. The failure occurred because these column names were being used as table aliases in the code, causing conflicts.

Code change

  • Modified BigQueryEventConsumer.java

Tested

(Same configurations used in both cases)

Before changes:

2025-03-05 23:14:25,377 - ERROR [bq-daemon-3:i.c.d.b.BigQueryEventConsumer@1478] - Failed to merge a batch of changes from the staging table into test2.MyTable
com.google.cloud.bigquery.BigQueryException: Value has type STRUCT<_op STRING, _batch_id INT64, _sequence_num INT64, ...> which cannot be inserted into column D, which has type STRING at [14:71]

After changes:

2025-03-05 23:28:03,354 - INFO  [bq-daemon-0:i.c.d.b.BigQueryEventConsumer@796] - Loading batch 1741217199562 of 5 events into target table for test2.MyTable 
2025-03-05 23:29:33,352 - INFO  [bq-daemon-2:i.c.d.b.BigQueryEventConsumer@796] - Loading batch 1741217323821 of 1 events into staging table for test2.MyTable 
2025-03-05 23:29:36,950 - INFO  [bq-daemon-2:i.c.d.b.BigQueryEventConsumer@898] - Merging batch 1741217323821 for test2.MyTable

@sahusanket
Copy link
Contributor

NIT :
Can you please replace the alias Values in comments as well?

There are multiple places where logic is explained using alias, so it will be easy to refer.

@anshumanks
Copy link
Contributor Author

NIT : Can you please replace the alias Values in comments as well?

There are multiple places where logic is explained using alias, so it will be easy to refer.

I intentionally left it that way. When I changed the values in the comment, it became unreadable because of so many underscores.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/data-integrations/bigquery-delta-plugins/pull/274

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy