{"record":{"id":"529f8c277941e064","repo":"hibernate/hibernate-orm","slug":"summarization-is-not-supported-by-dbms-529f8c","errorCode":null,"errorMessage":"Summarization is not supported by DBMS!","messagePattern":"Summarization is not supported by DBMS!","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixSqlAstTranslator.java","lineNumber":189,"sourceCode":"\t\t\tList<SqlSelection> lhsExpressions,\n\t\t\tSqlTuple tuple,\n\t\t\tComparisonOperator operator) {\n\t\temulateSelectTupleComparison( lhsExpressions, tuple.getExpressions(), operator, true );\n\t}\n\n\t@Override\n\tprotected void renderPartitionItem(Expression expression) {\n\t\t// We render an empty group instead of literals as some DBs don't support grouping by literals\n\t\t// Note that integer literals, which refer to select item positions, are handled in #visitGroupByClause\n\t\tif ( expression instanceof Literal ) {\n\t\t\t// Note that this depends on the SqmToSqlAstConverter to add a dummy table group\n\t\t\tappendSql( \"dummy_.x\" );\n\t\t}\n\t\telse if ( expression instanceof Summarization ) {\n\t\t\t// This could theoretically be emulated by rendering all grouping variations of the query and\n\t\t\t// connect them via union all but that's probably pretty inefficient and would have to happen\n\t\t\t// on the query spec level\n\t\t\tthrow new UnsupportedOperationException( \"Summarization is not supported by DBMS!\" );\n\t\t}\n\t\telse {\n\t\t\texpression.accept( this );\n\t\t}\n\t}\n\n\t@Override\n\tprotected void renderInsertIntoNoColumns(TableInsertStandard tableInsert) {\n\t\trenderIntoIntoAndTable( tableInsert );\n\t\tappendSql( \"values (0)\" );\n\t}\n\n\tprivate boolean supportsParameterOffsetFetchExpression() {\n\t\treturn getDialect().getVersion().isSameOrAfter( 11 );\n\t}\n\n\tprivate boolean supportsSkipFirstClause() {\n\t\treturn getDialect().getVersion().isSameOrAfter( 11 );","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixSqlAstTranslator.java#L171-L207","documentation":"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.","triggerScenarios":"Executing HQL/criteria with 'group by rollup(...)' or 'group by grouping sets(...)' against InformixDialect; the Summarization node reaches renderPartitionItem() during SQL AST translation.","commonSituations":"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.","solutions":["Rewrite as separate per-level grouped queries combined with UNION ALL","Move the rollup logic into the application (aggregate streams or in-memory grouping)","Use a native Informix query if your Informix version offers grouping extensions Hibernate does not model"],"exampleFix":"// before\n\"select region, product, sum(s.amount) from Sale s group by rollup(s.region, s.product)\"\n\n// after\n\"select s.region, s.product, sum(s.amount) from Sale s group by s.region, s.product\" +\n\" union all \" +\n\"select s.region, null, sum(s.amount) from Sale s group by s.region\" +\n\" union all \" +\n\"select null, null, sum(s.amount) from Sale s\"","handlingStrategy":"try-catch","validationCode":"static boolean dialectSupportsSummarization(Dialect d) {\n    return !(d instanceof InformixDialect);\n}\nif ( !dialectSupportsSummarization(session.getJdbcServices().getDialect())\n        && hql.toLowerCase().matches(\"(?s).*(rollup|grouping\\\\s+sets)\\\\s*\\\\(.*\") ) {\n    // use union-all fallback\n}","typeGuard":"static boolean isInformix(Dialect d) { return d instanceof InformixDialect; }","tryCatchPattern":"try {\n    return session.createQuery(hql, Object[].class).getResultList();\n} catch (UnsupportedOperationException e) {\n    if ( String.valueOf(e.getMessage()).contains(\"Summarization\") ) {\n        return runUnionAllFallback(hql);\n    }\n    throw e;\n}","preventionTips":["Treat rollup/grouping sets as dialect-specific SQL - isolate it in native queries or dedicated repository methods","Add a query-catalog smoke test per dialect so unsupported query shapes fail at build time, not in production","Document for your team which analytics features each supported database allows"],"tags":["hibernate","informix","group-by","rollup","grouping-sets","dialect"],"backgroundTag":"dialect-unsupported-sql-feature","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}