google-bigquery

Bigquery If field exists

匆匆过客 提交于 2021-01-28 01:04:51
问题 Short: Is there a way to query in BQ fields that don't exist, receiving nulls for these fields? I have almost the same issue that BigQuery IF field exists THEN but sometimes my APIs can query tables were there are not some particular fields (historic tables) and this approach fails because it needs a table with that field: SELECT a, b, c, COALESCE(my_field, 0) as my_field FROM (SELECT * FROM <somewhere w/o my_field>), (SELECT * FROM <somewhere with my_field>) Is there a way to do something

BigQuery Blockchain Dataset is Missing Data?

别等时光非礼了梦想. 提交于 2021-01-27 21:21:30
问题 I'm trying to do some analysis on the richest Bitcoin wallets, and discovered that the BigQuery dataset is missing a ton of data. For example, take a look at the #1 richest account currently. The wallet address is: "3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r" If I look this wallet up in blockexplorer, or any online blockchain data source, I see that the wallet has received ~3.29 million and sent ~3.16 million for a net balance of 138,660 BTC. Yet when I look any transcations where inputpubkeybase58 =

Is google analytics new user affected by lookback window?

≯℡__Kan透↙ 提交于 2021-01-27 19:05:43
问题 I recently found out that visitNumber in big query google analytics export starts over at 1 if a user has not visited the site in 183 days or more. I am now trying to understand if the same lookback window is applied when google analytics defines new users? 回答1: The result of SUM(totals.newVisits) in bigquery is exactly the same as the new user count reported in Google Analytics Audience report for a day in my exported data that has users marked as new visitors eventhough they have visited

Scheduling insert on a clustered table BigQuery

牧云@^-^@ 提交于 2021-01-27 18:35:11
问题 I have the following sheduled querie, im just trying to append data every day but it is giving me the an error: SELECT PARSE_DATE('%Y%m%d',event_date) AS fecha, indicador FROM `TABLE_*` WHERE _TABLE_SUFFIX BETWEEN FORMAT_DATE("%Y%m%d", DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)) AND FORMAT_DATE("%Y%m%d", DATE_SUB(CURRENT_DATE(), INTERVAL 0 DAY)) GROUP BY event_date,indicador ERROR: Incompatible table partitioning specification. Destination table exists with partitioning specification interval

How can I encode characters like emojis as UTF8 without unpaired surrogate characters?

為{幸葍}努か 提交于 2021-01-27 17:23:54
问题 I have strings with a variety of characters that need to be written to Google BigQuery, which requires strict UTF8 strings. When trying to write strings with a wide variety of emoji input, I get an error: java.lang.IllegalArgumentException: Unpaired surrogate at index 3373 at org.apache.beam.sdk.repackaged.com.google.common.base.Utf8.encodedLengthGeneral(Utf8.java:93) at org.apache.beam.sdk.repackaged.com.google.common.base.Utf8.encodedLength(Utf8.java:67) at org.apache.beam.sdk.coders

Is Approximate String Matching / Fuzzy String Searching possible with BigQuery?

谁说我不能喝 提交于 2021-01-27 15:00:52
问题 Thanks to Google for delivering BigQuery, it's great! Is Approximate String Matching / Fuzzy String Searching possible with BigQuery? Does Google have plans to add this functionality to BigQuery? Surely the Google proprietary Approximate String Matching algorithm could be used to deliver this capability to BigQuery while still maintaining Google Intellectual Property. We've searched all the BigQuery documentation and Stack Overflow questions. Of course there are many algorithms to do this,

How to export crash-free users from firebase?

旧街凉风 提交于 2021-01-27 14:22:23
问题 I want to persist data about crashes and metrics of crash-free users in my database for further analyze. I have already linked the project to BigQuery, but can't find a way to calculate crash-free users value by data, which contained in BigQuery. It's possible to export crash-free users metrics in some way? 回答1: Fabric/Firebaser here - The Firebase Crashlytics export to BigQuery doesn't include crash-free users because Google Analytics for Firebase is needed to calculate the crash-free users

Doing a concat over a partition in SQL?

痴心易碎 提交于 2021-01-27 13:38:13
问题 I have some data ordered like so: date, uid, grouping 2018-01-01, 1, a 2018-01-02, 1, a 2018-01-03, 1, b 2018-02-01, 2, x 2018-02-05, 2, x 2018-02-01, 3, z 2018-03-01, 3, y 2018-03-02, 3, z And I wanted a final form like: uid, path 1, "a-a-b" 2, "x-x" 3, "z-y-z" but running something like select a.uid ,concat(grouping) over (partition by date, uid) as path from temp1 a Doesn't seem to want to play well with SQL or Google BigQuery (which is the specific environment I'm working in). Is there an

Doing a concat over a partition in SQL?

╄→尐↘猪︶ㄣ 提交于 2021-01-27 13:29:57
问题 I have some data ordered like so: date, uid, grouping 2018-01-01, 1, a 2018-01-02, 1, a 2018-01-03, 1, b 2018-02-01, 2, x 2018-02-05, 2, x 2018-02-01, 3, z 2018-03-01, 3, y 2018-03-02, 3, z And I wanted a final form like: uid, path 1, "a-a-b" 2, "x-x" 3, "z-y-z" but running something like select a.uid ,concat(grouping) over (partition by date, uid) as path from temp1 a Doesn't seem to want to play well with SQL or Google BigQuery (which is the specific environment I'm working in). Is there an

How to use string functions in the ON clause of a LEFT JOIN with standard SQL in BigQuery?

允我心安 提交于 2021-01-27 11:41:53
问题 I'm having trouble wrapping my head around using a string function such as STARTS_WITH or an operator such as LIKE in a LEFT JOIN ON where the parameters of either come from both tables in the join. Rather than try to explain the abstracts, I've distilled a small example ... Let's consider a table called fuzzylog that has a key field fullname that I want to canonicalize by joining to a names table that has the same column. The key field in fuzzylog may be a bit messy or free-form so a direct