The full programmatic interface may be inconvenient for ad-hoc query entry during debugging or for advanced application users. To satisfy these use cases, the Analytics API also provides a text-based syntax.
The majority of this syntax is based on a subset of the SQL language, providing familiarity for developers used to working with relational database systems. To create Analytics query objects based on the text-based syntax, a factory parser method is provided by the AnalyticsQuery class.
For example:
String str = … // Initialized to valid query AnalyticsQuery analytics = AnalyticsQuery.parseQuery(str);
The competing desires of familiarity and efficiency are balanced by using a subset of SQL with additional enhancements that can be efficiently implemented.