AI-generated Key Takeaways
- 
          
This document outlines possible errors that can occur when performing a query.
 - 
          
Errors can relate to invalid syntax, such as bad field names, bad operators, or invalid escape sequences.
 - 
          
Issues with values, such as incorrect data types, invalid numbers, or values outside the allowed range, are also listed as potential errors.
 - 
          
Problems with specific clauses like SELECT, FROM, WHERE, and ORDER BY are covered, including missing or prohibited elements.
 - 
          
Other errors include unexpected input, unterminated strings, and exceeding limits like the number of values in a filter or too many segments.
 
Enum describing possible query errors.
| Enums | |
|---|---|
 | 
                Name unspecified. | 
 | 
                The received error code is not known in this version. | 
 | 
                Returned if all other query error reasons are not applicable. | 
 | 
                A condition used in the query references an invalid enum constant. | 
 | 
                Query contains an invalid escape sequence. | 
 | 
                Field name is invalid. | 
 | 
                Limit value is invalid (for example, not a number) | 
 | 
                Encountered number can not be parsed. | 
 | 
                Invalid operator encountered. | 
 | 
                Parameter unknown or not supported. | 
 | 
                Parameter have invalid value. | 
 | 
                Invalid resource type was specified in the FROM clause. | 
 | 
                Non-ASCII symbol encountered outside of strings. | 
 | 
                Value is invalid. | 
 | 
                Date filters fail to restrict date to a range smaller than 31 days. Applicable if the query is segmented by date. | 
 | 
                Filters on date/week/month/quarter have a start date after end date. | 
 | 
                Expected AND between values with BETWEEN operator. | 
 | 
                Expecting ORDER BY to have BY. | 
 | 
                There was no dimension field selected. | 
 | 
                Missing filters on date related fields. | 
 | 
                Missing FROM clause. | 
 | 
                The operator used in the conditions requires the value to be a list. | 
 | 
                Fields used in WHERE or ORDER BY clauses are missing from the SELECT clause. | 
 | 
                SELECT is missing at the beginning of query. | 
 | 
                A list was passed as a value to a condition whose operator expects a single value. | 
 | 
                Missing one or both values with BETWEEN operator. | 
 | 
                Invalid date format. Expected 'YYYY-MM-DD'. | 
 | 
                Misaligned date value for the filter. The date should be the start of a week/month/quarter if the filtered field is segments.week/segments.month/segments.quarter. | 
 | 
                Value passed was not a string when it should have been. For example, it was a number or unquoted literal. | 
 | 
                A String value passed to the BETWEEN operator does not parse as a date. | 
 | 
                The value passed to the DURING operator is not a Date range literal | 
 | 
                An invalid value was passed to the LIKE operator. | 
 | 
                An operator was provided that is inapplicable to the field being filtered. | 
 | 
                A Condition was found with an empty list. | 
 | 
                A condition used in the query references an unsupported enum constant. | 
 | 
                Fields that are not allowed to be selected together were included in the SELECT clause. | 
 | 
                A field that is not orderable was included in the ORDER BY clause. | 
 | 
                A field that is not selectable was included in the SELECT clause. | 
 | 
                A field that is not filterable was included in the WHERE clause. | 
 | 
                Resource type specified in the FROM clause is not supported by this service. | 
 | 
                A field that comes from an incompatible resource was included in the SELECT clause. | 
 | 
                A field that comes from an incompatible resource was included in the WHERE clause. | 
 | 
                A metric incompatible with the main resource or other selected segmenting resources was included in the SELECT or WHERE clause. | 
 | 
                A segment incompatible with the main resource or other selected segmenting resources was included in the SELECT or WHERE clause. | 
 | 
                A segment in the SELECT clause is incompatible with a metric in the SELECT or WHERE clause. | 
 | 
                The value passed to the limit clause is too low. | 
 | 
                Query has a string containing a newline character. | 
 | 
                List contains values of different types. | 
 | 
                The values passed to the BETWEEN operator are not of the same type. | 
 | 
                Query contains unterminated string. | 
 | 
                Too many segments are specified in SELECT clause. | 
 | 
                Query is incomplete and cannot be parsed. | 
 | 
                FROM clause cannot be specified in this query. | 
 | 
                Query contains one or more unrecognized fields. | 
 | 
                Query has an unexpected extra part. | 
 | 
                Metrics cannot be requested for a manager account. To retrieve metrics, issue separate requests against each client account under the manager account. | 
 | 
                The number of values (right-hand-side operands) in a filter exceeds the limit. |