analyst045
analyst045

Reputation: 648

How to insert/update a partitioned table in Big Query

Problem statement: I need to insert/update a few columns in a big query table that is partitioned by date.So basically I need to do the necessary changes for each partitioned date (done by day).
(its the sessions table that is created automatically by linking the GA View to BQ so I haven't done the partition manually but its automatically taken care by google).

query reference from google_docs

my query:

MY QUERY AND ERROR

I also tried the below :

enter image description here

Can anyone help me here ? sorry I am a bit naive with BQ.

Upvotes: 0

Views: 2244

Answers (2)

Felipe Hoffa
Felipe Hoffa

Reputation: 59165

As Hua said, ga_sessions_* is not a partitioned table, but represents many tables, each with a different suffix.

You probably want to do this then:

INSERT INTO `p.d.ga_sessions_20191125` (visitNumber, visitId)
SELECT 1, 1574

Upvotes: 1

Hua Zhang
Hua Zhang

Reputation: 1551

You are trying to insert into a wildcard table, a meta-table that is actually composed of multiple tables. Wildcard table is read only and cannot be inserted into.

Upvotes: 1

Related Questions