Database Reference
In-Depth Information
}
]
}
The full projection includes the configuration, which may contain a lot of
data. This particular job is a Load job, so it has the table schema, which can
be hundreds or thousands of fields. Query jobs have the SQL query that was
run, which also can take up a lot of space in the response.
Field Restrictions
Projections are a somewhat coarse way of specifying the fields you care
about. Field restrictions, on the other hand, allow you to specify exactly
the fields you want. The advantage of projections is that they are easy
to use—you don't have to know exactly what you want. The advantage of
specifying exact field lists is that you have control over exactly what you
get in response. All BigQuery collections support field restrictions for all
operations. To specify the set of fields you want to see in the result, list
them as a comma-delimited URL query parameter, as in
fields= field1 , field2 , … . Nested fields can be specified via
parentheses. For example, to list just the id and totalItems fields from
the Projects collection, you can specify:
$ curl -H "$(python auth.py)" \
"${PROJECTS_URL}?alt=json&fields=projects(id),totalItems"
{
"projects": [
{
"id": "bigquery-e2e"
},
{
"id": "420824040427"
}
],
"totalItems": 3
}
Search WWH ::




Custom Search