{"record":{"id":"f360696a58b003fa","repo":"hibernate/hibernate-orm","slug":"singlestore-doesn-t-support-all-clause","errorCode":null,"errorMessage":"SingleStore doesn't support ALL clause","messagePattern":"SingleStore doesn't support ALL clause","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SingleStoreSqlAstTranslator.java","lineNumber":227,"sourceCode":"\t\t// Check if current query part is already row numbering to avoid infinite recursion\n\t\treturn useOffsetFetchClause(\n\t\t\t\tqueryPart ) && getQueryPartForRowNumbering() != queryPart && supportsWindowFunctions() && !isRowsOnlyFetchClauseType(\n\t\t\t\tqueryPart );\n\t}\n\n\t@Override\n\tprotected boolean shouldEmulateLateralWithIntersect(QueryPart queryPart) {\n\t\treturn getDialect().supportsSimpleQueryGrouping() || !queryPart.hasOffsetOrFetchClause();\n\t}\n\n\t@Override\n\tpublic void visitAny(Any any) {\n\t\tthrow new UnsupportedOperationException( \"SingleStore doesn't support ANY clause\" );\n\t}\n\n\t@Override\n\tpublic void visitEvery(Every every) {\n\t\tthrow new UnsupportedOperationException( \"SingleStore doesn't support ALL clause\" );\n\t}\n\n\t@Override\n\tpublic void visitQueryGroup(QueryGroup queryGroup) {\n\t\tif ( shouldEmulateFetchClause( queryGroup ) ) {\n\t\t\temulateFetchOffsetWithWindowFunctions( queryGroup, true );\n\t\t}\n\t\telse {\n\t\t\tsuper.visitQueryGroup( queryGroup );\n\t\t}\n\t}\n\n\t@Override\n\tpublic void visitQuerySpec(QuerySpec querySpec) {\n\t\tif ( shouldEmulateFetchClause( querySpec ) ) {\n\t\t\temulateFetchOffsetWithWindowFunctions( querySpec, true );\n\t\t}\n\t\telse {","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SingleStoreSqlAstTranslator.java#L209-L245","documentation":"SingleStoreSqlAstTranslator.visitEvery() throws UnsupportedOperationException during SQL rendering because SingleStore does not support the ALL quantifier that EVERY maps to (the message says ALL clause). When Hibernate's semantic model contains an Every node - HQL 'x = all(select ...)', 'x <> all(select ...)' and similar - translation aborts before any SQL is sent. Note this covers quantified comparisons, not the every() aggregate over a group.","triggerScenarios":"Executing HQL such as 'select o from Order o where o.code <> all(select c.code from Coupon c)' or 'where o.total <= all(select b.cap from Budget b)' on SingleStore; criteria equivalents built with every()/all comparisons.","commonSituations":"Porting from databases where '= all' / '<> all' are idiomatic; shared repository abstractions that render quantified predicates uniformly; dynamic query builders that choose all() for exclusion semantics.","solutions":["Rewrite 'x < all(sub)' as 'x < (select min(s) from sub)' and 'x > all(sub)' as 'x > (select max(s) from sub)'","Rewrite 'x <> all(sub)' as 'not exists (select 1 from sub where s = x)'","Rewrite 'x = all(sub)' as 'x = (select min(s) from sub) and x = (select max(s) from sub)' when the subquery is narrow"],"exampleFix":"// before\nselect o from Order o where o.code <> all(select c.code from Coupon c)\n\n// after\nselect o from Order o where not exists (select 1 from Coupon c where c.code = o.code)","handlingStrategy":"validation","validationCode":"static boolean usesAllQuantifier(String hql) {\n    String lower = hql.toLowerCase();\n    return lower.contains(' all(') || lower.contains('=all(') || lower.contains('<>all(');\n}\n\nif (dialect instanceof SingleStoreDialect && usesAllQuantifier(hql)) {\n    throw new UnsupportedOperationException(\n        'SingleStore does not support ALL; rewrite as min/max or not-exists');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Rewrite '<> all(...)' as 'not exists (...)' for portable exclusion semantics","Use min/max scalar subqueries for <all/>all comparisons","Keep quantifier usage out of shared query libraries unless every target DB supports it"],"tags":["hibernate","singlestore","sql-translator","all","every","quantified-subquery","hql"],"backgroundTag":"unsupported-quantified-subquery","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}