hibernate/hibernate-orm · error · UnsupportedOperationException

Summarization is not supported by DBMS!

Error message

Summarization is not supported by DBMS!

What it means

RDMSOS2200 has no rollup/cube/grouping-sets support at any version; renderPartitionItem() throws UnsupportedOperationException whenever a Summarization appears among the GROUP BY items. The source comment notes the only theoretical emulation is a union-all of all grouping variations, which the translator deliberately does not attempt.

Source

Thrown at hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/RDMSOS2200SqlAstTranslator.java:99

			ComparisonOperator operator) {
		emulateSelectTupleComparison( lhsExpressions, tuple.getExpressions(), operator, true );
	}

	@Override
	protected void visitCaseSearchedExpression(CaseSearchedExpression caseSearchedExpression, boolean inSelect) {
		visitDecodeCaseSearchedExpression( caseSearchedExpression );
	}

	@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 );
		}
	}

}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Emulate rollup/cube with union all of the grouped variants
  2. Compute subtotal and total rows in the application or reporting layer
  3. Route that particular report to a database that supports grouping sets

Example fix

-- before (HQL)
select e.dept, sum(e.amount) from Expense e group by rollup(e.dept)

-- after: emulate
select e.dept, sum(e.amount) from Expense e group by e.dept
union all
select null, sum(e.amount) from Expense e
Defensive patterns

Strategy: fallback

Validate before calling

boolean supportsSummarization = false; // RDMSOS2200: never
if ( queryUsesRollupOrCube( hql ) && !supportsSummarization ) {
    hql = buildUnionAllEmulation( hql ); // subtotal rows via union all
}

Try / catch

try {
    return em.createQuery( hql ).getResultList();
}
catch ( UnsupportedOperationException e ) {
    if ( e.getMessage() != null && e.getMessage().contains( "Summarization" ) ) {
        return em.createQuery( unionAllEmulationHql ).getResultList();
    }
    throw e;
}

Prevention

When it happens

Trigger: Any HQL 'group by rollup(...)' / 'cube(...)' / 'grouping sets(...)' query translated through RDMSOS2200SqlAstTranslator.

Common situations: Shared report HQL run against multiple databases including a legacy Unisys RDMS/OS2200 instance; analytics features enabled globally in a product that must also support this dialect.

Related errors


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