QueryError

  • 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.

Proto definition

Enums

BAD_ENUM_CONSTANT

A condition used in the query references an invalid enum constant.

BAD_ESCAPE_SEQUENCE

Query contains an invalid escape sequence.

BAD_FIELD_NAME

Field name is invalid.

BAD_LIMIT_VALUE

Limit value is invalid (for example, not a number)

BAD_NUMBER

Encountered number can not be parsed.

BAD_OPERATOR

Invalid operator encountered.

BAD_PARAMETER_NAME

Parameter unknown or not supported.

BAD_PARAMETER_VALUE

Parameter have invalid value.

BAD_RESOURCE_TYPE_IN_FROM_CLAUSE

Invalid resource type was specified in the FROM clause.

BAD_SYMBOL

Non-ASCII symbol encountered outside of strings.

BAD_VALUE

Value is invalid.

DATE_RANGE_TOO_NARROW

Filters on date/week/month/quarter have a start date after end date.

DATE_RANGE_TOO_WIDE

Date filters fail to restrict date to a range smaller than 31 days. Applicable if the query is segmented by date.

EXPECTED_AND

Expected AND between values with BETWEEN operator.

EXPECTED_BY

Expecting ORDER BY to have BY.

EXPECTED_DIMENSION_FIELD_IN_SELECT_CLAUSE

There was no dimension field selected.

EXPECTED_FILTERS_ON_DATE_RANGE

Missing filters on date related fields.

EXPECTED_FROM

Missing FROM clause.

EXPECTED_LIST

The operator used in the conditions requires the value to be a list.

EXPECTED_REFERENCED_FIELD_IN_SELECT_CLAUSE

Fields used in WHERE or ORDER BY clauses are missing from the SELECT clause.

EXPECTED_SELECT

SELECT is missing at the beginning of query.

EXPECTED_SINGLE_VALUE

A list was passed as a value to a condition whose operator expects a single value.

EXPECTED_VALUE_WITH_BETWEEN_OPERATOR

Missing one or both values with BETWEEN operator.

FILTER_HAS_TOO_MANY_VALUES

The number of values (right-hand-side operands) in a filter exceeds the limit.

INVALID_DATE_FORMAT

Invalid date format. Expected 'YYYY-MM-DD'.

INVALID_STRING_VALUE

Value passed was not a string when it should have been. For example, it was a number or unquoted literal.

INVALID_VALUE_WITH_BETWEEN_OPERATOR

A String value passed to the BETWEEN operator does not parse as a date.

INVALID_VALUE_WITH_DURING_OPERATOR

The value passed to the DURING operator is not a Date range literal

INVALID_VALUE_WITH_LIKE_OPERATOR

An invalid value was passed to the LIKE operator.

LIMIT_VALUE_TOO_LOW

The value passed to the limit clause is too low.

MISALIGNED_DATE_FOR_FILTER

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.

OPERATOR_FIELD_MISMATCH

An operator was provided that is inapplicable to the field being filtered.

PROHIBITED_EMPTY_LIST_IN_CONDITION

A Condition was found with an empty list.

PROHIBITED_ENUM_CONSTANT

A condition used in the query references an unsupported enum constant.

PROHIBITED_FIELD_COMBINATION_IN_SELECT_CLAUSE

Fields that are not allowed to be selected together were included in the SELECT clause.

PROHIBITED_FIELD_IN_ORDER_BY_CLAUSE

A field that is not orderable was included in the ORDER BY clause.

PROHIBITED_FIELD_IN_SELECT_CLAUSE

A field that is not selectable was included in the SELECT clause.

PROHIBITED_FIELD_IN_WHERE_CLAUSE

A field that is not filterable was included in the WHERE clause.

PROHIBITED_METRIC_IN_SELECT_OR_WHERE_CLAUSE

A metric incompatible with the main resource or other selected segmenting resources was included in the SELECT or WHERE clause.

PROHIBITED_NEWLINE_IN_STRING

Query has a string containing a newline character.

PROHIBITED_RESOURCE_TYPE_IN_FROM_CLAUSE

Resource type specified in the FROM clause is not supported by this service.

PROHIBITED_RESOURCE_TYPE_IN_SELECT_CLAUSE

A field that comes from an incompatible resource was included in the SELECT clause.

PROHIBITED_RESOURCE_TYPE_IN_WHERE_CLAUSE

A field that comes from an incompatible resource was included in the WHERE clause.

PROHIBITED_SEGMENT_IN_SELECT_OR_WHERE_CLAUSE

A segment incompatible with the main resource or other selected segmenting resources was included in the SELECT or WHERE clause.

PROHIBITED_SEGMENT_WITH_METRIC_IN_SELECT_OR_WHERE_CLAUSE

A segment in the SELECT clause is incompatible with a metric in the SELECT or WHERE clause.

PROHIBITED_VALUE_COMBINATION_IN_LIST

List contains values of different types.

PROHIBITED_VALUE_COMBINATION_WITH_BETWEEN_OPERATOR

The values passed to the BETWEEN operator are not of the same type.

QUERY_ERROR

Returned if all other query error reasons are not applicable.

REQUESTED_METRICS_FOR_MANAGER

Metrics cannot be requested for a manager account. To retrieve metrics, issue separate requests against each client account under the manager account.

STRING_NOT_TERMINATED

Query contains unterminated string.

TOO_MANY_SEGMENTS

Too many segments are specified in SELECT clause.

UNEXPECTED_END_OF_QUERY

Query is incomplete and cannot be parsed.

UNEXPECTED_FROM_CLAUSE

FROM clause cannot be specified in this query.

UNEXPECTED_INPUT

Query has an unexpected extra part.

UNKNOWN

The received error code is not known in this version.

UNRECOGNIZED_FIELD

Query contains one or more unrecognized fields.

UNSPECIFIED

Name unspecified.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-12 UTC.