hibernate/hibernate-orm · error · UnsupportedOperationException
Summarization is not supported by DBMS
Error message
Summarization is not supported by DBMS
What it means
The legacy HSQLDB SQL translator throws UnsupportedOperationException from renderPartitionItem() when a query's GROUP BY contains a Summarization expression (ROLLUP / GROUPING SETS). The code comment notes it could theoretically be emulated by union-ing all grouping variations, but since that must happen at the query-spec level the translator refuses the query instead of producing wrong SQL.
Source
Thrown at hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/HSQLLegacySqlAstTranslator.java:309
render( rhs, SqlAstNodeRenderingMode.NO_PLAIN_PARAMETER );
}
break;
default:
renderComparisonStandard( lhs, operator, rhs );
break;
}
}
@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 );
}
}
private boolean supportsOffsetFetchClause() {
return getDialect().getVersion().isSameOrAfter( 2, 5 );
}
@Override
protected void visitArithmeticOperand(Expression expression) {
render( expression, SqlAstNodeRenderingMode.NO_PLAIN_PARAMETER );
}
}
View on GitHub (pinned to fad1729dce)
Solutions
- Rewrite the aggregation as explicit per-level queries combined with UNION ALL
- Compute the grouping sets in Java: fetch the detailed rows and aggregate with streams, or run separate grouped queries
- Use a native query for the HSQLDB test profile, or switch tests to a database whose dialect supports summarization
Example fix
// before "select dept, count(e) from Employee e group by rollup(e.dept)" // after "select e.dept, count(e) from Employee e group by e.dept" + " union all " + "select null, count(e) from Employee e"
Defensive patterns
Strategy: try-catch
Validate before calling
static boolean dialectSupportsSummarization(Dialect d) {
return !(d instanceof HSQLLegacyDialect);
}
if ( !dialectSupportsSummarization(session.getJdbcServices().getDialect())
&& hql.toLowerCase().matches("(?s).*(rollup|grouping\\s+sets)\\s*\\(.*") ) {
// rewrite or skip
} Type guard
static boolean isLegacyHsqldb(Dialect d) { return d instanceof HSQLLegacyDialect; } Try / catch
try {
return em.createQuery(hql, Object[].class).getResultList();
} catch (UnsupportedOperationException e) {
if ( String.valueOf(e.getMessage()).contains("Summarization") ) {
return runGroupingSetsFallback(hql); // union-all or in-memory aggregation
}
throw e;
} Prevention
- Do not let production rollup queries leak into HSQLDB test profiles - maintain separate test fixtures
- Centralize analytics queries behind a repository that can swap implementations per dialect
- Prefer UNION ALL rewrites when the query must be truly portable
When it happens
Trigger: Executing HQL/criteria with 'group by rollup(...)' or 'group by grouping sets(...)' on HSQLLegacyDialect; renderPartitionItem() receives the Summarization node during SQL generation and throws.
Common situations: Running analytics/reporting HQL originally written for Oracle or SQL Server against an HSQLDB in-memory test database; test suites that reuse production @NamedQueries; CI pipelines booting HSQLDB where rollup was never exercised locally.
Related errors
- Summarization is not supported by DBMS
- Summarization is not supported by DBMS!
- Summarization is not supported by DBMS!
- Summarization is not supported by DBMS!
- Summarization is not supported by DBMS!
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/fc4e7d1a2ab20415.
Report an issue: GitHub.