Category "google-bigquery"

Patterns for replicating data to BigQuery

I'm asking for the best practice/industrial standard on these types of jobs, this is what I've been doing: The end goal is to have a replication of the data in

Translating an Excel concept into SQL

Let's say I have the following range in Excel named MyRange: This isn't a table by any means, it's more a collection of Variant values entered into cells. Exce

BigQuery: Best way to handle frequent schema changes?

Our BigQuery schema is heavily nested/repeated and constantly changes. For example, a new page, form, or user-info field to the website would correspond to new

Stage level data is not coming for bigquery running jobs through java bigquery libraries

I am using com.google.cloud.bigquery library for fetching the job level details. We have the following code snippets Job job = getBigQuery(projectId, location)

How can I access Schema from the QueryResponse while calling getQueryResults method from my Java application?

I am using google.cloud.bigquery library to execute and create query using bigquery.query() method. I want to fetch the Schema details from the response but whe

Extract data from JSON column

i want to extract a value from a json column. The schema is (- first level, -- second level): Column Name | Type | Mode event_params RECORD NULLABLE -key STRI

Bigquery keyword Remote is not supported

We are trying out the REMOTE functions within bigquery as per this guide. We created the CLOUD_RESOURCE using the following command : bq mk --connection --disp

how to list ALL table sizes in a project

Is there a way to list all the table size in BigQuery? I know a command like this: select table_id, sum(size_bytes)/pow(10,9) as size from certain_data

BigQuery insert values AS, assume nulls for missing columns

Imagine there is a table with 1000 columns. I want to add a row with values for 20 columns and assume NULLs for the rest. INSERT VALUES syntax can be used for t

Scheduling data extract from Google BigQuery using export data

I am trying to schedule monthly data exports in Google bigquery using query scheduler. This is how my query looks atm: export data options( uri='gs://bucket_nam

Google Big Query - loading a csv file - Error while reading table

I'm trying to upload a report in CSV fotmat to Google Big Query. The report contains the following column names: Adjustment Type; Day; Country; Asset ID; As

LEFT JOIN with an OR in the ON clause BigQuery Standard SQL

I need some help understanding joins in bigquery standard sql. I want to do a left join keeping all the columns in table1, and joining to table2 if 2 fields mat

Is there any way to unnest bigquery columns in databricks in single pyspark script

I am trying to connect bigquery using databricks latest version(7.1+, spark 3.0) with pyspark as script editor/base language. We ran a below pyspark script to f

SQL Big Query - Add new column to table with query results?

I'd like to take two columns (latitude and longitude) and create a single column with the combined information. The final goal is (a) see if I can gather useful

Export Firebase to Bigquery dataset time to live

Update: I found a solution for my first question meaning changing to never expires: I applied this code to my dataset and the firesbase console now showing neve

How to use BigQuery API from elixir code

How to use BigQuery from elixir code? I would like to use Big Query web API from elixir code. Although there is no elixir client SDK in SDK libraries page I w

Extract last 16 character from a sentence in BigQuery

I need to extract last 16 characters from a sentence under a title column of a table using bigquery. My table is like this: title No Commission inc GST - FY20 H

Google cloud "mk" error "Invalid identifier 'ch04' for mk."

I am very new to google cloud and following an example in "Google BigQuery: The Definitive Guide" to learn to use this platform. I am trying to make a dataset t

BigQuery Internal error when running Merge

I am executing a query for merging tables. I execute this same query every week, but this time it throws me an internal error. I waited and tried it again the s

BigQuery: Aggregate multiple fields into array

I have some data where for each ID I want to aggregate two or more fields into an array, and I want them to match in terms of order. So for example if I have t