Category "google-bigquery"

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

Is there a way to use a kmeans, tensorflow saved model in bigquery?

I know this is kind of stupid since BigQueryML now provides Kmeans with good initialization. Nonetheless I was required to train a model in tensorflow and then

DISTINCT result of ARRAY_CONCAT_AGG in BigQuery

I need to compute distinct set of items from the aggregated arrays. I cannot use the array_concat as suggested in similar threads, as I don't know how many arra

BigQuery cannot use analytic function in SELECT * REPLACE

For a large database project of mine, I have adopted a structure of building tables with nested structs, and combining these tables together (again using struct

BigQuery sort a CONCAT of multiple string columns in SELECT

First I will present example of what I'm trying to achieve, and then will share a bit more info. This is a relatively straightforward task to explain, however I

Elastic search with Google Big Query

I have the event logs loaded in elasticsearch engine and I visualise it using Kibana. My event logs are actually stored in the Google Big Query table. Currently

Convert Date to Text in BigQuery

I need to convert date to text format in bigquery. I used below sytax in my query- STRING(DATE(TimeStanmp_1)). please let me know if this is correct

ERROR - secure_channel() got an unexpected keyword argument 'default_scopes' with .to_dataframe() on bigquery object

Environment Details Python 3.7.12 google-api-core 1.23.0 google-auth 1.35.0 bigquery 2.3.1 let me know if i can provide any other library versions We are queryi