Database Reference
In-Depth Information
functions use 1-based indexing; there is no 0 th element. Here is a query that
computes the difference in importance levels between the applications in the
first and last position:
SELECT AVG(importance_delta) FROM (
SELECT
(NTH(1, running.importance.level)
- LAST(running.importance.level)) WITHIN RECORD
AS importance_delta
FROM [bigquery-e2e:ch10.sample_data])
The Parallel Lists query recipe that describes how to zip together two
parallel repeated fields demonstrates the use of POSITION . Note that it is
illegal to use POSITION on a non-repeated field.
Query Errors
Errors associated with query jobs fall into three categories:
• Transient
• Invalid user input
• Execution failures
The first two classes of errors can occur on any of the API operations.
Of course, because queries can be complicated and are susceptible to a
variety of syntax and semantic errors, it is common to encounter the second
class of errors. The error message is usually clear enough to determine
the problematic parts. Unfortunately, there are times when the message is
cryptic, and there is no simple prescription for dealing with these cases.
The best you can do is report instances of unhelpful messages through the
support channels described in the introduction. The last class covers cases
where the query is well formed but cannot be computed due to limitations
in the execution engine. These types of errors are the focus of this section
because in some cases workarounds exist.
Search WWH ::




Custom Search