hibernate/hibernate-orm · error · UnsupportedOperationException

Summarization is not supported by DBMS!

Error message

Summarization is not supported by DBMS!

What it means

TimesTen has no native support for ROLLUP/CUBE/GROUPING SETS, which reach the translator as a Summarization expression in GROUP BY. The UNION ALL emulation over grouping variations is not implemented, so renderPartitionItem throws UnsupportedOperationException instead of producing invalid SQL.

Source

Thrown at hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TimesTenSqlAstTranslator.java:105

	@Override
	protected void renderSelectTupleComparison(
			List<SqlSelection> lhsExpressions,
			SqlTuple tuple,
			ComparisonOperator operator) {
		emulateSelectTupleComparison( lhsExpressions, tuple.getExpressions(), operator, true );
	}

	@Override
	protected void renderPartitionItem(Expression expression) {
		if ( expression instanceof Literal ) {
			appendSql( "'0' || '0'" );
		}
		else if ( expression instanceof Summarization ) {
			// This could theoretically be emulated by rendering all grouping variations of the query and
			// connect them via union all but that's probably pretty inefficient and would have to happen
			// on the query spec level
			throw new UnsupportedOperationException( "Summarization is not supported by DBMS!" );
		}
		else {
			expression.accept( this );
		}
	}

	protected void renderRowsToClause(QuerySpec querySpec) {
		if ( querySpec.isRoot() && hasLimit() ) {
			prepareLimitOffsetParameters();
			renderRowsToClause( getOffsetParameter(), getLimitParameter() );
		}
		else {
			assertRowsOnlyFetchClauseType( querySpec );
			renderRowsToClause( querySpec.getOffsetClauseExpression(), querySpec.getFetchClauseExpression() );
		}
	}

	protected void renderRowsToClause(Expression offsetClauseExpression, Expression fetchClauseExpression) {

View on GitHub (pinned to fad1729dce)

Solutions

  1. Expand the grouping sets into an explicit UNION ALL of individual GROUP BY queries
  2. Use plain GROUP BY and compute totals in application code
  3. Run the report as native SQL
  4. Move that report to a database with native grouping-set support

Example fix

// before
select e.cat, count(e) from Event e group by rollup(e.cat)

// after
select e.cat, count(e) from Event e group by e.cat
union all
select null, count(e) from Event e
Defensive patterns

Strategy: fallback

Validate before calling

static boolean dialectSupportsSummarization(Dialect d) {
    return !(d instanceof TimesTenDialect); // plus Sybase family and Teradata
}

Try / catch

try {
    return runGroupingSetsQuery(hql);
} catch (UnsupportedOperationException e) {
    if (e.getMessage() != null && e.getMessage().contains("Summarization")) {
        return runUnionAllEquivalent(hql);
    }
    throw e;
}

Prevention

When it happens

Trigger: HQL with `group by rollup(...)`, `group by cube(...)` or `group by grouping sets(...)` (or the Criteria equivalents) executed with TimesTenDialect.

Common situations: In-memory analytics queries written for other databases and re-run on TimesTen; shared reporting code that includes grouping sets.

Related errors


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/043693a27f600c22. Report an issue: GitHub.