hibernate/hibernate-orm · error · UnsupportedOperationException

Summarization is not supported by DBMS!

Error message

Summarization is not supported by DBMS!

What it means

InformixSqlAstTranslator.renderPartitionItem() refuses Summarization expressions (ROLLUP / GROUPING SETS). The inline comment states the only possible emulation is rendering every grouping variation of the query and connecting them with UNION ALL, which has to happen at the query-spec level rather than per group-by item, so the translator throws UnsupportedOperationException instead.

Source

Thrown at hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixSqlAstTranslator.java:189

			List<SqlSelection> lhsExpressions,
			SqlTuple tuple,
			ComparisonOperator operator) {
		emulateSelectTupleComparison( lhsExpressions, tuple.getExpressions(), operator, true );
	}

	@Override
	protected void renderPartitionItem(Expression expression) {
		// We render an empty group instead of literals as some DBs don't support grouping by literals
		// Note that integer literals, which refer to select item positions, are handled in #visitGroupByClause
		if ( expression instanceof Literal ) {
			// Note that this depends on the SqmToSqlAstConverter to add a dummy table group
			appendSql( "dummy_.x" );
		}
		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 );
		}
	}

	@Override
	protected void renderInsertIntoNoColumns(TableInsertStandard tableInsert) {
		renderIntoIntoAndTable( tableInsert );
		appendSql( "values (0)" );
	}

	private boolean supportsParameterOffsetFetchExpression() {
		return getDialect().getVersion().isSameOrAfter( 11 );
	}

	private boolean supportsSkipFirstClause() {
		return getDialect().getVersion().isSameOrAfter( 11 );

View on GitHub (pinned to fad1729dce)

Solutions

  1. Rewrite as separate per-level grouped queries combined with UNION ALL
  2. Move the rollup logic into the application (aggregate streams or in-memory grouping)
  3. Use a native Informix query if your Informix version offers grouping extensions Hibernate does not model

Example fix

// before
"select region, product, sum(s.amount) from Sale s group by rollup(s.region, s.product)"

// after
"select s.region, s.product, sum(s.amount) from Sale s group by s.region, s.product" +
" union all " +
"select s.region, null, sum(s.amount) from Sale s group by s.region" +
" union all " +
"select null, null, sum(s.amount) from Sale s"
Defensive patterns

Strategy: try-catch

Validate before calling

static boolean dialectSupportsSummarization(Dialect d) {
    return !(d instanceof InformixDialect);
}
if ( !dialectSupportsSummarization(session.getJdbcServices().getDialect())
        && hql.toLowerCase().matches("(?s).*(rollup|grouping\\s+sets)\\s*\\(.*") ) {
    // use union-all fallback
}

Type guard

static boolean isInformix(Dialect d) { return d instanceof InformixDialect; }

Try / catch

try {
    return session.createQuery(hql, Object[].class).getResultList();
} catch (UnsupportedOperationException e) {
    if ( String.valueOf(e.getMessage()).contains("Summarization") ) {
        return runUnionAllFallback(hql);
    }
    throw e;
}

Prevention

When it happens

Trigger: Executing HQL/criteria with 'group by rollup(...)' or 'group by grouping sets(...)' against InformixDialect; the Summarization node reaches renderPartitionItem() during SQL AST translation.

Common situations: Cross-database reporting queries reused on Informix; migrating analytics code from Oracle/SQL Server dialects; enabling a shared report module on an Informix environment for the first time.

Related errors


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