{"record":{"id":"043693a27f600c22","repo":"hibernate/hibernate-orm","slug":"summarization-is-not-supported-by-dbms-043693","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/TimesTenSqlAstTranslator.java","lineNumber":105,"sourceCode":"\n\t@Override\n\tprotected void renderSelectTupleComparison(\n\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\tif ( expression instanceof Literal ) {\n\t\t\tappendSql( \"'0' || '0'\" );\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\tprotected void renderRowsToClause(QuerySpec querySpec) {\n\t\tif ( querySpec.isRoot() && hasLimit() ) {\n\t\t\tprepareLimitOffsetParameters();\n\t\t\trenderRowsToClause( getOffsetParameter(), getLimitParameter() );\n\t\t}\n\t\telse {\n\t\t\tassertRowsOnlyFetchClauseType( querySpec );\n\t\t\trenderRowsToClause( querySpec.getOffsetClauseExpression(), querySpec.getFetchClauseExpression() );\n\t\t}\n\t}\n\n\tprotected void renderRowsToClause(Expression offsetClauseExpression, Expression fetchClauseExpression) {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TimesTenSqlAstTranslator.java#L87-L123","documentation":"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.","triggerScenarios":"HQL with `group by rollup(...)`, `group by cube(...)` or `group by grouping sets(...)` (or the Criteria equivalents) executed with TimesTenDialect.","commonSituations":"In-memory analytics queries written for other databases and re-run on TimesTen; shared reporting code that includes grouping sets.","solutions":["Expand the grouping sets into an explicit UNION ALL of individual GROUP BY queries","Use plain GROUP BY and compute totals in application code","Run the report as native SQL","Move that report to a database with native grouping-set support"],"exampleFix":"// before\nselect e.cat, count(e) from Event e group by rollup(e.cat)\n\n// after\nselect e.cat, count(e) from Event e group by e.cat\nunion all\nselect null, count(e) from Event e","handlingStrategy":"fallback","validationCode":"static boolean dialectSupportsSummarization(Dialect d) {\n    return !(d instanceof TimesTenDialect); // plus Sybase family and Teradata\n}","typeGuard":null,"tryCatchPattern":"try {\n    return runGroupingSetsQuery(hql);\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"Summarization\")) {\n        return runUnionAllEquivalent(hql);\n    }\n    throw e;\n}","preventionTips":["Expand grouping sets to UNION ALL in portable code","Compute subtotals in Java for TimesTen-backed services","Pin analytical query coverage per backend in CI"],"tags":["hibernate","timesten","grouping-sets","rollup","cube"],"backgroundTag":"grouping-sets-not-supported","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}