0

Bit of a 2-parter,

I have uploaded a table with quite over 100 columns, some of which are IDs which BigQuery detects as INTEGER type. When I want to change these to STRING, usually a little prompt appears after clicking on the table that says something along the lines of "re-run the upload with adjusted schema" which allows me to change the type very easily while leaving others, saving me having to write the whole schema again. But this prompt does not appear every time, my first question is:

Is there a way to force this prompt, or access it differently?

Following on from this, it would be really handy to export the schema from an existing table in the text/JSON format that is accepted by BigQuery, does anyone know if it's possible to export a schema, or does anyone know of a quick workaround to get a schema?

Thanks in advance

EDIT Thanks to Bobbylank for pointing me to this similar question Is there a way to export a BigQuery table's schema as JSON?

If anyone knows of a way to do this from the web UI that would be amazing

Ryan
  • 109
  • 2
  • 11
  • For the 2nd part https://stackoverflow.com/questions/43195143/is-there-a-way-to-export-a-bigquery-tables-schema-as-json – Bobbylank Jun 04 '18 at 14:20
  • Thank you for that link, ideally I was wanting the option to be available in the web UI, but I tried it from the command line and it's good to know there's a workaround – Ryan Jun 04 '18 at 15:17
  • Sorry, I have a habit of reading half a requirement! In the web UI, the only way you can do something similar is to literally select and copy the schema. It copies the 'NULLABLE' and 'Describe this field' columns too so hardly ideal – Bobbylank Jun 05 '18 at 07:01
  • No need to apologise, thanks for the answer! Yeah at the minute I'm copying the schema into notepad++, removing the nullable and description columns, replacing the space with ":" and converting the newline into ",". Seems like the quickest way I've found, but I know that BQ has the schema available as you can get it from the command you linked me to. – Ryan Jun 05 '18 at 11:03
  • You can refer to [this post](https://stackoverflow.com/questions/44880755/how-to-export-schema-for-the-existing-table-through-webui-in-bigquery) for web UI. Let me know if this works. – Rubén C. Jun 11 '18 at 09:14
  • Yeah that works too, both options are viable workarounds really I just guess there's no command line equivalent in the web UI (yet). Thanks for your help guys – Ryan Jul 09 '18 at 09:10

0 Answers0