[英]Google AppScript large multi-line query string (BigQuery) issue
I have been perplexed by this issue for a long time.我被这个问题困扰了很久。 I work with pretty massive multi-line bigquery sql strings.
我使用相当大的多行 bigquery sql 字符串。 When I go to schedule them using Google AppScript, I have to spend hours trying to format them because:
当我 go 使用 Google AppScript 安排它们时,我不得不花费数小时尝试格式化它们,因为:
And to use them in appscript, I have to convert them in a format like this要在 appscript 中使用它们,我必须将它们转换为这样的格式
var queryString = " -- MEASUREMENTS AT DAY LEVEL " queryString += "---------------------------------------------------------------------------------------------------------------------------- " queryString += "-- ** All marketing pages and whether logged in or out " queryString += "-- UNION " queryString += "-- All marketing pages irrespective of logged in or out " queryString += "---------------------------------------------------------------------------------------------------------------------------- " queryString += "\n SELECT 'day' as measurement_period,"
( This question has an example appscript that runs a SQL. That SQL has been formatted to be in one line. In my case it will be multi-line) ( 这个问题有一个运行 SQL 的示例应用脚本。SQL 已被格式化为一行。在我的例子中它将是多行)
Any suggestions how I could possibly avoid this and: 1. Either just copy paste a code block?有什么建议可以避免这种情况,并且: 1. 要么只是复制粘贴一个代码块? 2. Or use a "saved query" from my bigquery account?
2. 或者使用我的 bigquery 帐户中的“保存的查询”?
Thank you!谢谢!
It looks like the backslash is the line continuation character, so if you end each line with a backslash, that should work to make a really long queryString.看起来反斜杠是行继续字符,所以如果您以反斜杠结束每一行,那应该可以生成一个非常长的 queryString。
ie IE
var queryString = "SELECT * FROM Foo;\ var queryString = "SELECT * FROM Foo;\
SELECT * FROM Bar" SELECT * 来自酒吧”
There's probably some limit to how long the queryString can be, but I don't know what that is. queryString 的长度可能有一些限制,但我不知道那是什么。
Seems like there should be a way to use a saved query, but I have not found it.似乎应该有一种方法可以使用已保存的查询,但我还没有找到。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.