-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to store BigQuery schemas for later use. #3419
Comments
@tweeter0830 There is no built-in support for serializing |
Thanks. |
I'll leave the issue open, as making those two functions public / better documented seems like a reasonable enhancement. |
E.g., I could see adding a |
#3786 doesn't fix this issue. |
|
The goal of this issue is to store the entire schema for a table (not a single field) and in a format which is "good" for people (i.e., with the appropriate top-level mapping / key holding that list). |
Similar use case. I have the JSON schema files in GCS already for all tables. |
Hello, feature requests will now be tracked in the project Feature Requests. I will close this issue now, please feel free to continue to address any issues/concerns here. |
Background With the BigQuery command-line tool, it's possible to specify a schema via a JSON file. See: https://cloud.google.com/bigquery/docs/schemas#using_a_json_schema_file Schema format:
Phase 1 This feature request is to add a helper function that can load such files and return a list of SchemaField objects.
Phase 1.b Add Phase 2 Blocked by #7693
This (optional) feature only works if a
Phase 3 If a |
cc @lbristol88 |
@tswast could you make We have the schema in gcs but need to touch it a bit before using in bigquery. FYI, we do this today: |
In the case of in-memory JSON, I'd prefer you pass in a file-like object, i.e.
Otherwise it gets a little tricky to disambiguate a path from file contents. |
Makes sense. |
Is there an easy way to get the schema from a BigQuery table and save it to disk for later use?
For example, say that I wanted to get the schema of a table that currently exists, save it to disk and later create a table with the same schema.
I see that there is such a thing as a SchemaField in the api, but there doesn't seem to be a clean way to serialize it.
The text was updated successfully, but these errors were encountered: