Skip to content

snapshot_table__ procedures don't work using project-implicit query #31

@takegue

Description

@takegue

In procedure, execute immediate statement cannot omit project_id.

For example, let consider following:

set @@dataset_project_id = "project-id-7288898082930342315";
call `bqmake.v0.snapshot_table__init`(
  (null, "sandbox", "sample_scd2")
  , (
    "a"
    , "select * from sandbox.sample_table"
    , null
  )
  , to_json(struct(false as dry_run))
)

The procedure call execute "select * from sandbox.sample_table"
and you expect to run "select * from project-id-7288898082930342315.sandbox.sample_table" .
But actually, snapshot_query is treated as "select * from bqmake.sandbox.sample_table" due to omiting project_id in BigQuery.

@@dataset_project_id doesn't also work.

workaround:

  • Avoiding using implicit project query to pass as argument
  • (future work) dynamic rewriting using @@dataset_project_id or @@project_id context;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions