google-bigquery

How can I find the previous page with Bigquery

倾然丶 夕夏残阳落幕 提交于 2021-01-29 12:51:00
问题 I want to find out the previous page where the current page is a product page. For example I have this page 'https://www.emag.ro/telefon-mobil-apple-iphone-x-64gb-4g-space-grey-mqac2rm-a/pd/DN094NBBM'and my previous page is this page 'https://www.emag.ro/search/telefoane-mobile/IPHONE/c?ref=srcql' How in terms of hitnumber I can return how many users had this behavior. I tried with this 2 query and I want to do a JOIN but I don't know how is better. Also, I tried with LAG function but I don't

How to add new column with metadata value to csv when loading it to bigquery

不打扰是莪最后的温柔 提交于 2021-01-29 11:59:37
问题 I have a daily csv file coming into my bucket on google storage and I built a function that load this csv and append it into a table in BigQuery when it comes in. However, I want to add a new column to the csv with the function execution id (context["id"]) before I load the data to Big query. is that possible? thanks in advance! def TimeTableToBigQuery(data, context): # Getting metadata about the uploaded file, the storage and datetime of insert excution_id = context['event_id'] bucketname =

How to compare column with arrays in BigQuery?

烈酒焚心 提交于 2021-01-29 11:24:18
问题 I have two tables in BigQuery. Table a keeps values in arrays. Table b has row for each value I want to have all values from table b by id if at least one value not in array from table a by the same id WITH a as (SELECT 1 as id, ['123', 'abc', '456', 'qaz', 'uqw'] as value UNION ALL SELECT 2, ['123', 'wer', 'thg', '10', '200'] UNION ALL SELECT 3, null), b as (SELECT 1 as id, '123' as value UNION ALL SELECT 1, 'abc' UNION ALL SELECT 1, '456' UNION ALL SELECT 1, 'qaz' UNION ALL SELECT 1, 'uqw'

Is it possible to do a full text search in all tables in BigQuery?

◇◆丶佛笑我妖孽 提交于 2021-01-29 11:00:45
问题 In Oracle and SQL Server, it is possible to search all database objects for references of specific text: SELECT * FROM all_source WHERE UPPER(text) LIKE '%blah%' I would like to do the same thing in Google BigQuery. Is it possible to search every field of every table for a particular value in BigQuery? 回答1: If you wish to query multiple tables within a dataset in BigQuery, have a look at querying multiple tables using a wildcard table. If you would also like to search for a word in all

ClassCastException when reading nested list of records

五迷三道 提交于 2021-01-29 10:42:57
问题 I am reading in a BigQuery table from Dataflow where one of the fields is a "record" and "repeated" field. So I expected the resulting data type in Java to be List<TableRow> . However when I try to iterate over the list I get the following exception: java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.google.api.services.bigquery.model.TableRow The table schema looks something like this: { "id": "my_id", "values": [ { "nested_record": "nested" } ] } The code to iterate

Sending email through firebase cloud functions

孤街浪徒 提交于 2021-01-29 10:34:41
问题 I have a big query table containing email of the users and i want to send them a newsletter email ( around 500 rows in table) When the function runs it only sends email to 30-35 users after that time out, if i reduce the list to 100 it sends email for the multiple time on one email id Below is my code -: bigQuery.query({ exports.date = functions.https.onRequest((req, res) => { const bigQuery = bigquery({ projectId: 'littleone-150007' }); var someVar = []; var someVar1 =[]; bigQuery.query({

How to get an export of firebase analytics full historic data?

允我心安 提交于 2021-01-29 10:31:09
问题 I have setup Firebase analytics data to BigQuery. However I received my first export today and it contains all yesterdays user statistics. That is great but I need lifetime statistics history or at least last month's data. Do I already have access to my entire historic analytics data threw Big Query but I and I do not know how to access it? If so can you point to documentation or give a quick walk threw? Is it even possible to get the full (or at least a longer period than a day) historic

How to check if several values are in a list in BigQuery

女生的网名这么多〃 提交于 2021-01-29 10:16:42
问题 Is there a way to make this clause more compact? SELECT campaign ,event_list FROM `adobe_analytics.raw_data_20200*` WHERE campaign IS NOT NULL -- What does it mean when a campaign is null in Adobe_analytics AND ( "1" IN UNNEST(split(event_list,",")) OR "2" IN UNNEST(split(event_list,",")) OR "3" IN UNNEST(split(event_list,",")) ) Something like : SELECT campaign ,event_list FROM `adobe_analytics.raw_data_20200*` WHERE campaign IS NOT NULL AND ("1" OR "2" OR "3") IN UNNEST(split(event_list,","

Next.js with @google-cloud/bigquery : Unexpected error determining execution environment: process.emitWarning is not a function

风流意气都作罢 提交于 2021-01-29 10:01:51
问题 I am trying to run next.js project with @google-cloud/bigquery client library/ I get below error when running the project. TypeError: Unexpected error determining execution environment: process.emitWarning is not a function here is my next.config.js module.exports = { webpack: (config, { isServer }) => { // Fixes npm packages that depend on `fs` module if (!isServer) { config.node = { ...config.node, fs: "empty", child_process: "empty", net: "empty", tls: "empty", }; } return config; }, env:

ERROR: extra data after last expected column in Postgres

怎甘沉沦 提交于 2021-01-29 09:55:39
问题 I have a json file as: [xyz@innolx20122 ~]$ cat test_cgs.json {"technology":"AAA","vendor":"XXX","name":"RBNI","temporal_unit":"hour","regional_unit":"cell","dataset_metadata":"{\"name\": \"RBNI\", \"intervals_epoch_seconds\": [[1609941600, 1609945200]], \"identifier_column_names\": [\"CELLID\", \"CELLNAME\", \"NETWORK\"], \"vendor\": \"XXX\", \"timestamp_column_name\": \"COLLECTTIME\", \"regional_unit\": \"cell\"}","rk":1} which I am trying to upload to below table in Postgres CREATE TABLE