Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok think I got something here. That's a weird one... Actually it does not work if you have the same schema exactly (field mode).</p> <p>Here is the source table schema:</p> <pre><code> "schema": { "fields": [ { "name": "ID_CLIENT", "type": "INTEGER", "mode": "NULLABLE" }, { "name": "IDENTITE", "type": "STRING", "mode": "NULLABLE" } ] } </code></pre> <p>If if I use the copy functionality from the browser interface (bigquery.cloud.google.com), I get the exact same schema which is expected:</p> <pre><code>"schema": { "fields": [ { "name": "ID_CLIENT", "type": "INTEGER", "mode": "NULLABLE" }, { "name": "IDENTITE", "type": "STRING", "mode": "NULLABLE" } ] } </code></pre> <p>But then I cannot append from the following fetch to the copied table:</p> <pre><code>SELECT ID_CLIENT + 1 AS ID_CLIENT, RIGHT(IDENTITE,12) AS IDENTITE FROM datasetid.client </code></pre> <p>although it returns the same schema, at least from the browser interface view, internally this returns the following schema:</p> <pre><code>"schema": { "fields": [ { "name": "ID_CLIENT", "type": "INTEGER", "mode": "REQUIRED" }, { "name": "IDENTITE", "type": "STRING", "mode": "NULLABLE" } ] </code></pre> <p>}</p> <p>Which isn't the same schema exactly (check mode).</p> <p>And weirder this select:</p> <pre><code>SELECT ID_CLIENT, IDENTITE FROM datasetid.client </code></pre> <p>returns this schema:</p> <pre><code>"schema": { "fields": [ { "name": "ID_CLIENT", "type": "INTEGER", "mode": "REQUIRED" }, { "name": "IDENTITE", "type": "STRING", "mode": "REQUIRED" } ] } </code></pre> <p>Conclusion:</p> <p>Don't rely on tables schema information from the browser interface, always use Tables.get API. Copy doesn't really work as expected...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload