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 table gcp_bigquery_job. Closes #241 #247

Merged
merged 6 commits into from
Jul 1, 2021
Merged

Add table gcp_bigquery_job. Closes #241 #247

merged 6 commits into from
Jul 1, 2021

Conversation

bigdatasourav
Copy link
Contributor

Integration test logs

Logs
SETUP: tests/gcp_bigquery_job []

PRETEST: tests/gcp_bigquery_job

TEST: tests/gcp_bigquery_job
Running terraform
google_bigquery_dataset.named_test_resource: Creating...
google_bigquery_dataset.named_test_resource: Creation complete after 3s [id=projects/pikachu-aaa/datasets/turbottest24659]
google_bigquery_table.named_test_resource: Creating...
google_bigquery_table.named_test_resource: Creation complete after 1s [id=projects/pikachu-aaa/datasets/turbottest24659/tables/turbottest24659]
google_bigquery_job.named_test_resource: Creating...
google_bigquery_job.named_test_resource: Creation complete after 2s [id=projects/pikachu-aaa/jobs/turbottest24659]

Warning: Deprecated Resource

The null_data_source was historically used to construct intermediate values to
re-use elsewhere in configuration, the same can now be achieved using locals


Apply complete! Resources: 3 added, 0 changed, 0 destroyed.

Outputs:

project_id = "pikachu-aaa"
region_id = "US"
resource_aka = "gcp://bigquery.googleapis.com/projects/pikachu-aaa/jobs/turbottest24659"
resource_id = "pikachu-aaa:US.turbottest24659"
resource_name = "turbottest24659"

Running SQL query: test-get-query.sql
[
  {
    "id": "pikachu-aaa:US.turbottest24659",
    "job_id": "turbottest24659",
    "kind": "bigquery#job",
    "location": "US",
    "project": "pikachu-aaa"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "pikachu-aaa:US.turbottest24659",
    "job_id": "turbottest24659",
    "kind": "bigquery#job"
  }
]
✔ PASSED

Running SQL query: test-not-found-query.sql
null
✔ PASSED

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "gcp://bigquery.googleapis.com/projects/pikachu-aaa/jobs/turbottest24659"
    ],
    "title": "turbottest24659"
  }
]
✔ PASSED

POSTTEST: tests/gcp_bigquery_job

TEARDOWN: tests/gcp_bigquery_job

SUMMARY:

1/1 passed.

Example query results

Results
> select
  job_id,
  self_link,
  creation_time,
  location
from
  gcp_bigquery_job;
+-----------------+---------------------------------------------------------------------------------------------------+---------------------+----------+
| job_id          | self_link                                                                                         | creation_time       | location |
+-----------------+---------------------------------------------------------------------------------------------------+---------------------+----------+
| turbottest76164 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest76164?location=US | 2021-06-25 07:46:57 | US       |
| turbottest24659 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest24659?location=US | 2021-06-25 09:56:27 | US       |
| turbottest49597 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest49597?location=US | 2021-06-25 08:55:46 | US       |
| turbottest36667 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest36667?location=US | 2021-06-25 09:06:33 | US       |
| job1            | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/job1?location=US            | 2021-06-25 07:39:59 | US       |
| turbottest56089 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest56089?location=US | 2021-06-25 09:07:30 | US       |
| turbottest66929 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest66929?location=US | 2021-06-25 09:08:35 | US       |
| turbottest20237 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest20237?location=US | 2021-06-25 07:41:52 | US       |
| turbottest39458 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest39458?location=US | 2021-06-25 07:50:10 | US       |
+-----------------+---------------------------------------------------------------------------------------------------+---------------------+----------+
> select
  job_id,
  self_link,
  creation_time,
  location
from
  gcp_bigquery_job
where
  state = 'RUNNING';
+--------+-----------+---------------+----------+
| job_id | self_link | creation_time | location |
+--------+-----------+---------------+----------+
+--------+-----------+---------------+----------+
> select
  job_id,
  self_link,
  creation_time,
  location
from
  gcp_bigquery_job
where
  state = 'DONE';
+-----------------+---------------------------------------------------------------------------------------------------+---------------------+----------+
| job_id          | self_link                                                                                         | creation_time       | location |
+-----------------+---------------------------------------------------------------------------------------------------+---------------------+----------+
| job1            | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/job1?location=US            | 2021-06-25 07:39:59 | US       |
| turbottest66929 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest66929?location=US | 2021-06-25 09:08:35 | US       |
| turbottest49597 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest49597?location=US | 2021-06-25 08:55:46 | US       |
| turbottest24659 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest24659?location=US | 2021-06-25 09:56:27 | US       |
| turbottest36667 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest36667?location=US | 2021-06-25 09:06:33 | US       |
| turbottest56089 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest56089?location=US | 2021-06-25 09:07:30 | US       |
| turbottest39458 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest39458?location=US | 2021-06-25 07:50:10 | US       |
| turbottest20237 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest20237?location=US | 2021-06-25 07:41:52 | US       |
| turbottest76164 | https://bigquery.googleapis.com/bigquery/v2/projects/pikachu-aaa/jobs/turbottest76164?location=US | 2021-06-25 07:46:57 | US       |
+-----------------+---------------------------------------------------------------------------------------------------+---------------------+----------+

@bigdatasourav bigdatasourav self-assigned this Jun 25, 2021
@bigdatasourav bigdatasourav linked an issue Jun 25, 2021 that may be closed by this pull request
Copy link

@rajlearner17 rajlearner17 left a comment

Choose a reason for hiding this comment

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

LGTM

@Subhajit97 Subhajit97 requested a review from cbruno10 July 1, 2021 09:28
@cbruno10 cbruno10 changed the title Add table gcp_bigquery_jobs. Closes #241 Add table gcp_bigquery_job. Closes #241 Jul 1, 2021
@cbruno10 cbruno10 merged commit 9667320 into main Jul 1, 2021
@cbruno10 cbruno10 deleted the issue-241 branch July 1, 2021 18:35
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.

Add table gcp_bigquery_jobs
4 participants