Skip to content

Cherry-pick BigQuery query table function fix from upstream - #13

Closed
krvikash with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-bigquery-regression-issue
Closed

Cherry-pick BigQuery query table function fix from upstream#13
krvikash with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-bigquery-regression-issue

Conversation

Copilot AI commented Dec 8, 2025

Copy link
Copy Markdown

Description

Cherry-picked commit 69db99524346152b0551f573ae1a85390e8cca7d from upstream trinodb/trino repository. This commit fixes a regression where SELECT queries fail when reusing BigQuery query table function results.

Key changes:

  • Modified BigQuerySplitManager.java to check for existing destination table before creating a new one
  • Added regression test in BaseBigQueryConnectorTest.java

Conflict resolution:
The upstream commit modified BigQuerySplitSource.java, which no longer exists in this branch. The functionality was consolidated into BigQuerySplitManager.java, so the equivalent fix was applied there at lines 129-131.

// Before: Always creates new destination table
TableInfo tableInfo = new ViewMaterializationCache.DestinationTableBuilder(
    bigQueryClientFactory.create(session), viewExpiration, query, destinationTable).get();

// After: Reuses existing destination table if available
BigQueryClient bigQueryClient = bigQueryClientFactory.create(session);
Optional<TableInfo> bigQueryTable = bigQueryClient.getTable(destinationTable);
TableInfo tableInfo = bigQueryTable.orElseGet(() -> 
    new ViewMaterializationCache.DestinationTableBuilder(
        bigQueryClient, viewExpiration, query, destinationTable).get());

Additional context and related issues

Upstream issue: trinodb#27573

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)
Original prompt

create a new branch with name "krvikash/bigquery/regression/fix" cherry pick commit from trinodb@69db995 with -x. dont push any change.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix BigQuery regression issue by cherry-picking commit Cherry-pick BigQuery query table function fix from upstream Dec 9, 2025
Copilot AI requested a review from krvikash December 9, 2025 00:01
@krvikash krvikash closed this Dec 10, 2025
@krvikash
krvikash deleted the copilot/fix-bigquery-regression-issue branch December 10, 2025 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants