google-bigquery

What will be the wait time before big query executes a query?

天大地大妈咪最大 提交于 2020-01-06 16:04:45
问题 Every time I execute a query in Google bigquery in the Explanation tab, I can see that their involves an average waiting time. Is it possible to know the percentage or seconds of wait time? 回答1: Since BigQuery is a managed service, around the glob a lot of customers are using it. It has an internal scheduling system based on the billingTier (explained here https://cloud.google.com/bigquery/pricing#high-compute) and other internals of your project. Based on this the query is scheduled to be

Ignore duplicate records while appending in BigQuery

大憨熊 提交于 2020-01-06 14:27:29
问题 We are writing the data from MySql to BigQuery. We have set some indicators like Insert - If the records is being added first time, then save it with 'I' in Indicator field Update - If the record has some updated data, then save it with 'U' in the Indicator field and ignore duplicate records if not changed. But in case of 'Update' it's writing duplicated records as well, which has not even changed. Following is the query we are currently using to insert the data into BigQuery table. What

Why my bigquery sql is not returning any result?

戏子无情 提交于 2020-01-06 07:17:31
问题 I am querying on public dataset in bigquery. The sql is valid and bigquery UI showing message "This query will process 15.9 MB when run." but still I am getting blank output screenshot attached BigQuery result. Please find below the details of project. project - bigquery-public-data dataset - google_analytics_sample table - ga_sessions_20170801 I am using SELECT statement to get the all columns result. SELECT visitorId, visitNumber, visitId, visitStartTime, date, totals.visits, totals.hits,

Understanding self joins and flattening

对着背影说爱祢 提交于 2020-01-06 06:57:07
问题 I'll start with the fact that I'm a newbie and I managed to hack this original query together. I've looked over many examples but I'm just not wrapping my head around self joins and displaying the data I want to see. I'm feeding BQ with mobile app data daily and thus am querying multiple tables. I'm trying to query for a count of fatal crashes by IMEI by date. This query does give me most of the output I want as it returns Date, IMEI and Count. However, I want the output to be Date, IMEI,

BigQuery Stream and Delete while streaming buffer is not empty?

℡╲_俬逩灬. 提交于 2020-01-06 06:51:34
问题 BigQuery doesn't stream directly into their long term storage, they first put it into a write optimized store and periodically flush that to the main storage. I would like to understand BigQuery Streaming buffer better, in the following use cases. 1) what if I delete the bigquery table, and recreate a new bigquery table with the same name right away, when some records still stay in streaming buffer waiting to be flushed into main storage? For example, if I am streaming a million records into

BigQuery Stream and Delete while streaming buffer is not empty?

為{幸葍}努か 提交于 2020-01-06 06:51:28
问题 BigQuery doesn't stream directly into their long term storage, they first put it into a write optimized store and periodically flush that to the main storage. I would like to understand BigQuery Streaming buffer better, in the following use cases. 1) what if I delete the bigquery table, and recreate a new bigquery table with the same name right away, when some records still stay in streaming buffer waiting to be flushed into main storage? For example, if I am streaming a million records into

Not getting Authorization dialog for App Script accessing BigQuery Service

风格不统一 提交于 2020-01-06 06:48:31
问题 I am trying to fix some App Scripts which use the BigQuery "Advanced Service" to install some BigQuery jobs. The first new script I ran popped a BigQuery authorization dialog, and everything worked fine, now running hourly. The second new script ran initially, but is now failing with: { "error": { "errors": [ { "domain": "global", "reason": "required", "message": "Login Required", "locationType": "header", "location": "Authorization" } ], "code": 401, "message": "Login Required" } } This

Finding the query that created a table in BigQuery

风格不统一 提交于 2020-01-06 06:46:16
问题 I am a new employee at the company. The person before me had built some tables in BigQuery. I want to investigate the create table query for that particular table. Things I would want to check using the query is: What joins were used? What are the other tables used to make the table in question? I have not worked with BigQuery before but I did my due diligence by reading tutorials and the documentation. I could not find anything related there. 回答1: Brief outline of your actions below: Step 1

App maker: Show Big Query data in grid

限于喜欢 提交于 2020-01-06 06:46:10
问题 I having an script in googles app maker: function runQuery() { var projectId = 'blalab155512'; var request = { query: 'SELECT title FROM [bigquery-public-data:samples.wikipedia] where title contains "olimpic" LIMIT 100' }; var queryResults = BigQuery.Jobs.query(request, projectId); var jobId = queryResults.jobReference.jobId; var names = queryResults.schema.fields.map(function(field){ return field.name; }); //var records = []; return queryResults.rows.map(function(row) { var record = app

Finding unique users from linked values

大憨熊 提交于 2020-01-06 06:40:50
问题 I have values in my Table of this form. id | val1 | val2 -------------------- 1 | e1 | m1 2 | e1 | m2 3 | e2 | m2 4 | e3 | m1 5 | e4 | m3 6 | e5 | m3 7 | e5 | m4 8 | e4 | m5 From this, I have to recover unique users like this and give them a unique id to identify. User1 -> (val1 : e1, e2, e3 | val2: m1, m2) e1 <-> m1, e1 <-> m2, m1 <-> e3, e2 <-> m2 ( <-> means linked). e1 is connected to m1. e1 is connected to m2. m2 is connected to e2. So e1,m1 are connected to e2. Similarly, we find e1, e2