简体   繁体   English

如何在 BigQuery 计划查询错误消息中动态包含值?

[英]How to include values dynamically in BigQuery Scheduled Queries Error Message?

I managed to schedule a big query query that tests for equality between two tables (one at the granularity of a linen sheet level, while other is a daily roll up of linen sheet counts).我设法安排了一个大查询来测试两个表之间的相等性(一个在亚麻床单级别的粒度,而另一个是亚麻床单计数的每日汇总)。

However, i fail to include the actual value of the variance as the ERROR() argument only expects strings;但是,我没有包含方差的实际值,因为 ERROR() 参数只需要字符串; is there a way to say ERROR('Absolute Variance is {value x} - {value y} = {z} sheets')?有没有办法说错误('绝对方差是{value x} - {value y} = {z} sheets')?

   CASE WHEN 
    ABS( (sheet_counts.pass - daily_scan.approved_pieces )) >= 1 THEN
    ERROR('Absolute Variance between sheet level and day level counts is greater than 0 for yesterday, Dori - please investigate data flow job to ensure no job failed, Thank you !')
    ELSE 'pass' END AS sheet_daily_match,

Are you looking for the FORMAT function?您在寻找格式function 吗?

ERROR(FORMAT('Absolute Variance is %f - %f = %f sheets', x, y, z))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何以编程方式获取 bigquery 的计划查询执行日志? - How to get bigquery's scheduled queries execution log programmatically? BigQuery 仅在工作日安排的查询 - BigQuery Scheduled queries only on working days 在 bigquery 上运行 dbt 与预定查询 - Running dbt vs scheduled queries on bigquery 如何在视图或计划查询之间进行选择,以对通过 Stitch 导入的 BigQuery 表进行重复数据删除? - How to choose between Views or Scheduled Queries for de-duplicating BigQuery tables imported via Stitch? 在 BigQuery Google Cloud 中获取我所有计划的 SQL 查询 - Get all my scheduled SQL queries in BigQuery Google Cloud BigQuery 计划查询 - 创建表并在不同项目中为其名称添加日期后缀 - BigQuery scheduled queries - Create table and add date suffix to its name in a different project 如何在计划查询中显示和更改用户 - How to show and change user in Scheduled Queries 在 Bigquery 上创建计划查询时出错“创建计划查询时出错:呃” - Error when creating scheduled query on Bigquery "Error creating scheduled query: er" BigQuery 是否对 LIMIT 0 次查询收费? - Are LIMIT 0 queries billed in BigQuery? 尝试在 BigQuery 上创建表时收到“意外错误”消息 - Getting "unexpected error" message when trying to create table on BigQuery
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM