4 Messages
•
550 Points
How can I configure BigQuery Technical Lineage "other query" when I am using INFORMATION_SCHEMA.JOBS instead of ROUTINES/PARAMETERS
hello,
I am configuring a BigQuery Technical Lineage, but I have realized that in the section "other queries" the tables from information schema used is not the same from the default collibra query :
SELECTr.routine_name,CONCAT('CREATE ', r.routine_type, ' `', r.routine_schema, '.', r.routine_name, '`(',ARRAY_TO_STRING(ARRAY_AGG(CONCAT(p.parameter_name, ' ', p.data_type) ORDER BY p.ordinal_position), ', '),') ',CASE WHEN r.routine_type = 'FUNCTION'THEN CONCAT('AS (', r.routine_definition, ')')ELSE r.routine_definitionEND) as sourceCode,r.routine_type as groupName,r.routine_schema as schemaNameFROM `##PROJECT_ID##`.`##DSNAME##`.`INFORMATION_SCHEMA.ROUTINES` rJOIN `##PROJECT_ID##`.`##DSNAME##`.`INFORMATION_SCHEMA.PARAMETERS` pUSING (specific_catalog, specific_schema, specific_name)WHERE r.routine_body = 'SQL'AND p.is_result = 'NO'GROUP BY r.routine_schema, r.routine_name, r.routine_type, r.routine_definitionUNION ALLSELECTr.routine_name,CONCAT('CREATE ', r.routine_type, ' `', r.routine_schema, '.', r.routine_name, '`(',ARRAY_TO_STRING(ARRAY_AGG(CONCAT(p.parameter_name, ' ', p.data_type) ORDER BY p.ordinal_position), ', '),') ',CONCAT('LANGUAGE js AS """', r.routine_definition, '"""')) as sourceCode,r.routine_type as groupName,r.routine_schema as schemaNameFROM `##PROJECT_ID##`.`##DSNAME##`.`INFORMATION_SCHEMA.ROUTINES` rJOIN `##PROJECT_ID##`.`##DSNAME##`.`INFORMATION_SCHEMA.PARAMETERS` pUSING (specific_catalog, specific_schema, specific_name)WHERE r.external_language = 'JAVASCRIPT'AND p.is_result = 'NO'GROUP BY r.routine_schema, r.routine_name, r.routine_type, r.routine_definition
As what i want to use is as i have to use INFORMATION_SCHEMA.JOBS or INFORMATION_SCHEMA.JOBS.
After checking an example I have seen that the source code extracted in the default query is javascript but i have dbt / sql information in my source code.
Has anyone had this situation or has knowledge that could help me?
any help is welcome, thank you in advance!
Sincerely,
Williams Tom
kristof_van_coillie
2 Messages
•
100 Points
3 months ago
Hi,
You could give this query a try:
It will require these permissions.
Note that this is not officially supported.
Best Regards,
Kristof
0
0