admin管理员组

文章数量:1122832

I'd like to use the view INFORMATION_SCHEMA.JOBS_BY_FOLDER to get information about all the bigquery jobs in a folder that has no direct project but only contains folder that then contain projects. It doesn't seem possible because it says :

The INFORMATION_SCHEMA.JOBS_BY_FOLDER view contains near real-time metadata about all jobs submitted in the parent folder of the current project, including the jobs in subfolders under it.

But I'd like to be able to get the job of a folder that doesn't have direct child... To my surprise, it doesn't seem to be possible! Am I missing something? This means that unless you filter a request to JOBS_BY_ORGANIZATION, it is not possible to get the jobs of a projectless folder??

For example, let's say we have the folowing GCP organization :

.
└── folder_A
    ├── folder_B
    │   └── project_X
    └── folder_C
        └── project_Y

If I try to query INFORMATION_SCHEMA.JOBS_BY_FOLDER from project_X, I will only get the jobs executed in the parent folder (ie folder_B).

SELECT DISTINCT project_id from `project_X.region-europe-west4`.INFORMATION_SCHEMA.JOBS_BY_FOLDER`

Answer will be : | line | project_id | | ---- | ------------ | | 1 | project_X |

But I need:

line project_id
1 project_X
2 project_Y

I'd like to use the view INFORMATION_SCHEMA.JOBS_BY_FOLDER to get information about all the bigquery jobs in a folder that has no direct project but only contains folder that then contain projects. It doesn't seem possible because it says :

The INFORMATION_SCHEMA.JOBS_BY_FOLDER view contains near real-time metadata about all jobs submitted in the parent folder of the current project, including the jobs in subfolders under it.

But I'd like to be able to get the job of a folder that doesn't have direct child... To my surprise, it doesn't seem to be possible! Am I missing something? This means that unless you filter a request to JOBS_BY_ORGANIZATION, it is not possible to get the jobs of a projectless folder??

For example, let's say we have the folowing GCP organization :

.
└── folder_A
    ├── folder_B
    │   └── project_X
    └── folder_C
        └── project_Y

If I try to query INFORMATION_SCHEMA.JOBS_BY_FOLDER from project_X, I will only get the jobs executed in the parent folder (ie folder_B).

SELECT DISTINCT project_id from `project_X.region-europe-west4`.INFORMATION_SCHEMA.JOBS_BY_FOLDER`

Answer will be : | line | project_id | | ---- | ------------ | | 1 | project_X |

But I need:

line project_id
1 project_X
2 project_Y
Share Improve this question asked yesterday godotgodot 1,57016 silver badges34 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

It is not possible to query the job metadata of a folder that doesn't have a direct child which means projectless. If you want to get job metadata from multiple subfolders you can use INFORMATION_SCHEMA.JOBS_BY_FOLDER and use UNION ALL to list more than one project and a also query for jobs across your entire organization you can use JOBS_BY_ORGANIZATION. Refer to this link1 and link2 for more insights. If you are looking for a feature related to this you can raise a feature request in the issue tracker by providing a detailed description issue.

本文标签: