26,335 questions
-3
votes
0
answers
48
views
SQL subquery issue [closed]
enter image description here (SQL subquery problem)
enter image description here (SQL subquery problem)
See the same result came without using the subquery. So why should I use this complicated ...
0
votes
0
answers
46
views
BigQuery data is not inserted in tables
I'm having random data missing/not showing up in BigQuery issues. I would seemingly write data without issues, but SELECT * would return nothing.
The control panel shows no errors. None of the quotas ...
0
votes
1
answer
82
views
Calculate percent of total per firm and filter firms above 50%
I'm trying to calculate the percentage contribution of each firm to the total amount across all firms.
Database:
google-bigquery
What I need (desired output):
Sum usde_haircut_amt per firm
Compute ...
0
votes
0
answers
68
views
Can I send a JSON object to BigQuery without stringifying it?
I am trying to figure out if there is a way to send a JSON object to a BigQuery table that has a column of type JSON. I know the current practice is to stringify the JSON and send it over which gets ...
-6
votes
1
answer
48
views
BigQuery: How to replace 0 values with NULL in a column?
I’m trying to clean a BigQuery weather dataset where missing values were entered as 0. My UPDATE query to replace 0 with NULL is throwing an error. How can I correctly convert these zeroes to null ...
0
votes
0
answers
28
views
How to optimize a BigQuery query that uses multiple JOINs
I’m trying to optimize a BigQuery SQL query that joins several large tables. The query works, but it’s slow and more expensive than expected when running on production-scale datasets.
Below is a ...
1
vote
0
answers
67
views
Databricks always loads built-in BigQuery connector (0.22.2), can’t override with 0.43.x
I am using Databricks Runtime 15.4 (Spark 3.5 / Scala 2.12) on AWS.
My goal is to use the latest Google BigQuery connector because I need the direct write method (BigQuery Storage Write API):
option(&...
-1
votes
0
answers
35
views
[Simba}[BigQuery](310) Storage API Error: DNS resolution failed for service: http:. with verified connection to Google API
When trying to run a query with a large output (600,000 rows of data), I am getting an error :
[Simba}[BigQuery](310) Storage API Error: DNS resolution failed for service: http:.
I am using a proxy ...
0
votes
0
answers
24
views
Unable to fetch Accurate Performance Max (PMAX) YouTube Video Metrics via Google Ads Script / BigQuery Transfer
I’m currently working on a task to fetch and display daily Google ADS Manager (GAM) records—such as Cost, ROAS, and other metrics—within a data analysis application. I’ve successfully retrieved data ...
0
votes
0
answers
34
views
BigQuery TVFs Prevent Optimization, Lead to Higher Billing?
I work on a project in BigQuery using Looker Studio for dashboard visualizations. We recently saw our billing costs and usage skyrocket and are trying to determine the cause. Nothing fundamentally ...
-1
votes
0
answers
65
views
Connected Sheets with BigQuery
I'm trying to set up connected sheets in Google Sheets, which according to the link below, requires Delegated Access and the access set up in Organization Settings. Is it possible to set these up if I ...
Advice
0
votes
1
replies
44
views
Difference between DIV vs / in Bigquery
When i try to do division in bigquery, i saw this.
Initial implementation -> div (x / y) for this i got an error : No matching signature for function DIV Argument types: FLOAT64, FLOAT64 Signature: ...
0
votes
1
answer
71
views
How to reference a CSV column with parentheses and a decimal point in Spark SQL or COALESCE expression?
I’m working on a data ingestion pipeline using Apache Spark (triggered via a Cloud Function on Dataproc).
The input CSV contains column names that include special characters such as parentheses and a ...
0
votes
1
answer
92
views
Google Pub/Sub push subscription to BigQuery changes value in float data type
I have a BigQuery push subscription in Pub/Sub that for some reason changes the values of the fields with float datatype when pushed to BigQuery.
I tried creating a pull subscription and attached it ...
2
votes
0
answers
47
views
Why does a DELETE with a JOIN on partitioned columns in BigQuery cost more than dropping specific partitions?
I have a large BigQuery table, big_table, around 5 TB in size.
It is partitioned by the column partition_date, which has about 2000 distinct values.
I also have a smaller table, small_table, which ...
1
vote
0
answers
31
views
403 Permission error when creating BigQuery link with GA4 via Admin API (v1alpha)
I’m trying to use the Google Analytics Admin API (v1alpha) to link a GA4 property to BigQuery via the properties.bigQueryLinks.create method.
Here is my code using : https://developers.google.com/...
0
votes
0
answers
79
views
How to export BigQuery query results directly to GCS without creating a temporary table (using Java client)
I'm currently aware that I can export a BigQuery query result to Google Cloud Storage (GCS) by first creating a temporary table and then performing an extract table operation on that temp table.
...
0
votes
0
answers
62
views
Wrong REST response for retrieving Column Level Lineage in GCP BigQuery
I have got two BigQuery tables:
bigquery:ssh-test-project-01.SSh_Dataset_03.SSh_BgQ_Src_01 and
bigquery:ssh-test-project-01.SSh_Dataset_03.SSh_BgQ_Dst_BgQ_01.
Using Data Transfer with SQL:
"...
0
votes
1
answer
64
views
Vertex AI Agent Builder/Dialogflow CX: Cannot Set ID Key Property for BigQuery Data Store (UI Issue?) - Search Fails for IDs
I'm trying to connect a BigQuery table containing property listings (originally from an Excel/CSV file) to a Vertex AI Agent Builder / Dialogflow CX agent using a Structured Data Store. My goal is to ...
-1
votes
3
answers
98
views
“SELECT list expression references column X which is neither grouped nor aggregated” when using COUNT(*)? [closed]
I'm trying to run a simple SQL query in BigQuery like this:
SELECT usertype, COUNT(*)
FROM `project.dataset.table`;
But I get an error:
SELECT list expression references column usertype which is ...
1
vote
0
answers
100
views
BigQuery stopped auto-detecting columns for external tables on top of parquet files with custom partitions
Some of our BQ projects create external tables on top of parquet files like this:
CREATE OR REPLACE EXTERNAL TABLE my_dataset my_table
WITH PARTITION COLUMNS (ingestion_date DATE)
OPTIONS (
format ...
0
votes
1
answer
46
views
How to group by geography in Bigquery
I have the following code:
SELECT
h3s.h3id, h3s.geog,
MIN(ST_DISTANCE(`carto-os`.carto.H3_CENTER(htsp.h3id), `carto-os`.carto.H3_CENTER(h3s.h3id)))
OVER (PARTITION BY h3s.h3id)
FROM
...
0
votes
0
answers
48
views
Defining an external table in Dataform
I need to define an external table from Google sheet in Dataform - only a few columns from a given sheet should be used.
Some AI tools are saying that 'range' can be used in OPTIONS, but I guess it's ...
1
vote
2
answers
192
views
INFORMATION_SCHEMA.TABLE_STORAGE is not enabled for the project [closed]
We're a long time users of the Google BigQuery INFORMATION_SCHEMA.TABLE_STORAGE view, never had problem using it in our automated data processes. But a couple of days ago even the simpliest SELECT ...
0
votes
0
answers
53
views
Why do my BigQueryInsertJobOperator tasks in Cloud Composer show long queued durations before running?
I’m using Cloud Composer (Airflow) and have two BigQuery operators like this:
run_aggregation = BigQueryInsertJobOperator(
task_id='aggregation_task',
configuration={
"query":...
0
votes
0
answers
65
views
Way to transform a BalanceSheet from QBO inside BigQuery?
I'm using dbt models to transform a QBO Balance Sheet uploaded as a CSV into Bigquery.
Data comes from a fictional company inside QuickBooks test drives from which I export reports in CSV format.
Here'...
0
votes
0
answers
46
views
BigQuery reservation underutilized
I have configured and put into production a BigQuery environment for one of our customers, and we have a question that we cannot answer, even after numerous analyses on our part.
I configured the ...
1
vote
0
answers
67
views
BigQuery scheduled query can't read all columns from external table, but manual execution works fine
Problem
I have a BigQuery scheduled query that reads from an external table. When I run the query manually, it works perfectly and can access all columns. However, when the same query runs on a ...
-1
votes
1
answer
88
views
The analytics_storage value in consent mode is recorded as null
I've installed the Firebase SDK in my iOS app and am using Google Analytics to measure data. The data is exported to BigQuery.
The app incorporates consent mode for consent management. I was suddenly ...
0
votes
2
answers
180
views
How to pass a Python datetime to BigQuery through Avro?
I have a Python pipeline where I try to:
get some json data from an API response
modify it via duckdb (just in memory)
convert the resulting data to a list of python dicts (1 row: 1 dict)
Add a ...
0
votes
0
answers
60
views
BigQuery shows only MESSAGE_ACCEPTED (no MESSAGE_DELIVERED) for Admin SDK–sent iOS notifications
We use the Firebase Admin Java SDK to send push notifications to iOS devices.
Messages appear in the BigQuery firebase_messaging export with message_status = MESSAGE_ACCEPTED, but never progress to ...
1
vote
2
answers
165
views
DATAPROC - com.google.cloud.spark.bigquery.BigQueryRelationProvider not a subtype
I'm new to Dataproc and am having trouble running a job that accesses a PostgreSQL database (Compute Engine VM) to write data to BigQuery.
I created a cluster with the following configuration:
gcloud ...
0
votes
0
answers
27
views
firebase_crashlytics: missing user. id
I am using the table from firebase_crashlytics's export to BigQuery, but some records return a blank user_id, even though our development team has already completed the user_id setup. Firebase only ...
3
votes
1
answer
116
views
What is the optimal BigQuery SQL query to group the same data multiple times over different groups?
I have a very large BigQuery table with web events that I want to aggregate into daily, weekly and monthly numbers of visitors. And I want to join them into the same table.
My initial guess is to do ...
0
votes
1
answer
99
views
Implementing CASE-WHEN or Aggregations in Materialized Views in BigQuery
I have the below mentioned BigQuery SQL for a View. However, both the tables used in the query are huge in volume and hence I am facing terrible performance issues.
If you'd glance at the query, I am ...
0
votes
0
answers
71
views
Splitting and aggregating over time with BigQuery
Trying to write a query which will convert the input, which is list of events with a start and end time as well as the number of apples for that time slot. Example input as is shown below (timings ...
0
votes
1
answer
72
views
Dataform fails to create external table intermittently
My sqlx file
config {
type: "operations",
tags: ["soma_deal_meta_audience_reporting_pipeline"]
}
${operations.createSessionizerTable("...
1
vote
1
answer
62
views
export data query executes successfully but messages are not pushed to pub/sub topic
I ran this standard query and it executes successfully.
EXPORT DATA
OPTIONS (
uri = 'https://pubsub.googleapis.com/projects/ggdevbigqueryproject/topics/GGTEST',
format = 'JSON',
...
-3
votes
1
answer
88
views
Creating a table inside this SQL when running from BigQuery [closed]
WITH
CATALOG_SKU_CTE AS (
SELECT A.sku
FROM `catalog-stage.catalog_enterprise_views.sku_hierarchy_view` A, `catalog-stage.catalog_enterprise_views.sku_v` B
WHERE A.sku = B.SKU AND ...
0
votes
0
answers
96
views
Spark Scala: JSON Array Column Not Persisting to BigQuery Table
I'm hoping to get some help with an issue I'm having moving data from a JSON file to a BigQuery table using Spark.
The problem, in a nutshell:
Goal: Load a JSON file into a Spark DataFrame and persist ...
0
votes
1
answer
119
views
Can I enforce the BigQuery table schema when transfering from PostgreSQL with Google Cloud Dataflow?
I'm trying to create a job to mirror a view that I have in my PostgreSQL DB to a BigQuery table in my Google Cloud Project through Dataflow, I created the job using the "Job builder", and I'...
0
votes
0
answers
67
views
Any way to create a type alias in BigQuery?
I want to reuse the same struct in multiple user defined functions. Is there any way to alias the type so I don't have to write down the definition in full each time?
I.e. something like
DECLARE TYPE ...
0
votes
0
answers
71
views
google bigquery row insert error with nodejs sdk
I'm trying to store some data in the google bigquey using nestjs application. I was able to insert few records successfully and after that I changed a schema column. Now I can not insert any records ...
0
votes
1
answer
125
views
Generate BigQuery Table Insights using Gemini in Google Cloud feature
I'm looking for a way to programmatically trigger "Generate Insights for free" for all tables within a specific BigQuery INFORMATION_SCHEMA.
Currently, the only method I've found is to ...
1
vote
0
answers
102
views
Transfer Big Query dataset data to SQL Server using C#
I'm working on an ETL tool that can takes data from different sources (eg Snowflake, SQL, etc) and then, in this scenario, insert it into SQL database.
While when working with SQL/Snowflake APIs I ...
1
vote
1
answer
72
views
Date format showing incorrectly in Google sheet from Big Query API
Im using the Google Drive inventory reporting in Google workspace. Im using Apps Script to pull the data into a Google sheet, but the date and time is coming into the sheet in this format: 1.61E+09
...
0
votes
1
answer
138
views
How to sum two columns and calculate their average in BigQuery?
I'm working with Google BigQuery and I have a table with two numeric columns: grade1 and grade2. I want to calculate the total sum of both columns combined (row-wise) and then find the average of ...
1
vote
1
answer
89
views
Inconsistent Results for Boolean Filters in Bigquery based on whether the table is aliased
I'm getting really really inconsistent results, and I can't tell why. Here is the most obvious example:
Two queries:
select * from my_table
where invitation_deleted = true
-- returns 118 results
...
0
votes
1
answer
70
views
Missing "Create connection" option in BigQuery UI
I am unable to create an external connection in BigQuery. I am the Project Owner, but the option "Create connection" is missing from the UI.
Expected behavior: When I navigate to the "...
3
votes
1
answer
118
views
Facing bigquery write failure after upgrading spark and dataproc. "Schema mismatch : corresponding field path to Parquet column has 0 repeated field"s
We are currently undergoing migration from spark 2.4 to spark 3.5 (and dataproc 1 to 2), and our workflows are failing with the following error
Caused by: com.google.cloud.spark.bigquery.repackaged....