Giter Site home page Giter Site logo

bigquery's People

Contributors

adranwit avatar gopherus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bigquery's Issues

Support for temporary tables

I'm unable to create a temporary table using SQL.

See logs:

CREATE TEMP TABLE IF NOT EXISTS _SESSION.customers_customers_custom_snapshot_foo (id int)
WARN[0011] Failed to execute merge...not going to flush memory  error="failed to create temp table, error: failed to run job: artie-labs.job_Fidyw28jRgs4CRXmHFQS87VP4YNl, Use of CREATE TEMPORARY TABLE requires a script or session: [{\"message\":\"Use of CREATE TEMPORARY TABLE requires a script or session\",\"reason\":\"invalid\"}]" tableName=customers_custom_snapshot
INFO[0011] Flushing via pool...                          error="<nil>"

Temporary tables: https://cloud.google.com/bigquery/docs/multi-statement-queries#create_temporary_table

Issues with making MERGE commands

The SDK errors out and outputs an error:

sql: expected 4 arguments, got 0

However, this syntax is valid in BigQuery

MERGE INTO
  mock.customers_robin c
USING
  (
  SELECT
    1001 AS id,
    'Sally' AS first_name,
    'Thomas' AS last_name,
    '[email protected]' AS email,
    FALSE AS __artie_delete
  UNION ALL
  SELECT
    1002,
    'George',
    'Bailey',
    '[email protected]',
    FALSE
  UNION ALL
  SELECT
    1003,
    'Edward',
    'Walker',
    '[email protected]',
    FALSE
  UNION ALL
  SELECT
    1004,
    'Anne',
    'Kretchmar',
    '[email protected]',
    FALSE) AS cc
ON
  c.id = cc.id
  WHEN MATCHED AND cc.__artie_delete THEN DELETE
  WHEN MATCHED
  AND IFNULL(cc.__artie_delete, FALSE) = FALSE THEN
UPDATE
SET
  id = cc.id,
  first_name = cc.first_name,
  last_name = cc.last_name,
  email = cc.email
  WHEN NOT MATCHED
  AND IFNULL(cc.__artie_delete, FALSE) = FALSE THEN
INSERT
  ( id,
    first_name,
    last_name,
    email )
VALUES
  ( cc.id,cc.first_name,cc.last_name,cc.email );

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.