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

Add job_id parameter to BigQueryGetDataOperator #39315

Merged
merged 1 commit into from
May 3, 2024

Conversation

shahar1
Copy link
Contributor

@shahar1 shahar1 commented Apr 29, 2024

solves: #39127

This PR adds the job_id parameter to BigQueryGetDataOperator to fetch data from the results of selection queries executed by BigQueryInsertJobOperator (or any other querying interfaces). The new parameter is mutually exclusive with table_id and its related parameters (dataset_id and use_legacy_sql).

After merging this PR, the original issue of fetching results from complex queries (for example, queries with ORDER BY clauses) will be solved by running two operators sequentially:

  • Running the complex selection query with BigQueryInsertJobOperator
  • Running BigQueryGetDataOperator while providing job_id from the previous step (templated):
    job_id = "{{ task_instance.xcom_pull(task_ids='insert_job_op', key='return_value') }}"

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added area:providers provider:google Google (including GCP) related issues labels Apr 29, 2024
@shahar1 shahar1 force-pushed the bigquery-get-data-job-id branch 4 times, most recently from 8b1475b to 6bd4169 Compare April 29, 2024 20:06
@shahar1 shahar1 marked this pull request as ready for review April 29, 2024 20:06
@shahar1
Copy link
Contributor Author

shahar1 commented Apr 29, 2024

cc: @Lee-W, @eladkal

@dirrao dirrao requested review from Lee-W and eladkal April 30, 2024 03:39
@shahar1 shahar1 force-pushed the bigquery-get-data-job-id branch from 6bd4169 to 8c99df2 Compare April 30, 2024 19:04
@shahar1 shahar1 requested a review from Lee-W April 30, 2024 19:05
@shahar1 shahar1 force-pushed the bigquery-get-data-job-id branch from 8c99df2 to d2c2dff Compare April 30, 2024 19:50
@shahar1 shahar1 force-pushed the bigquery-get-data-job-id branch from d2c2dff to 7fd870f Compare May 1, 2024 16:34
@shahar1 shahar1 requested a review from Lee-W May 1, 2024 16:37
@shahar1 shahar1 force-pushed the bigquery-get-data-job-id branch from 7fd870f to 9013fe0 Compare May 1, 2024 16:55
@shahar1 shahar1 force-pushed the bigquery-get-data-job-id branch from 9013fe0 to db1c476 Compare May 1, 2024 18:00
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

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

LGTM

@Lee-W
Copy link
Member

Lee-W commented May 3, 2024

I'm thinking of merging this more these days. Please let me know if anyone want to take a deeper look 🙂

@eladkal eladkal merged commit 795592c into apache:main May 3, 2024
40 checks passed
@shahar1 shahar1 deleted the bigquery-get-data-job-id branch June 12, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers provider:google Google (including GCP) related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants