if (stateObject.isDecorated()) {
toText(stateObject);
}
else {
GroupByClause expression = stateObject.getExpression();
// 'GROUP BY'
appendIdentifier((expression != null) ? expression.getActualIdentifier() : GROUP_BY, GROUP_BY);
if (shouldOutput(expression) || expression.hasSpaceAfterGroupBy()) {
writer.append(SPACE);
}
// Group by items
if (stateObject.hasItems()) {