{"record":{"id":"fb67f76bba4c5890","repo":"hibernate/hibernate-orm","slug":"the-set-returning-from-node-s-does-not-specify","errorCode":null,"errorMessage":"The set-returning from node '%s' does not specify an index/ordinality","messagePattern":"The set-returning from node '(.+?)' does not specify an index/ordinality","errorType":"exception","errorClass":"FunctionArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java","lineNumber":6058,"sourceCode":"\t\tfinal boolean madeNested;\n\t\tif ( consumer instanceof QualifiedJoinPathConsumer qualifiedJoinPathConsumer ) {\n\t\t\tmadeNested = !qualifiedJoinPathConsumer.isNested();\n\t\t\tif ( madeNested ) {\n\t\t\t\tqualifiedJoinPathConsumer.setNested( true );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tmadeNested = false;\n\t\t}\n\t\tfinal var sqmPath = consumeDomainPath( ctx.path() );\n\t\tfinal boolean hasContinuation = ctx.getChildCount() == 5;\n\n\t\tfinal var referencedPathSource = sqmPath.getReferencedPathSource();\n\t\tfinal var firstNode = (TerminalNode) ctx.indexKeyQuantifier().getChild( 0 );\n\t\tif ( firstNode.getSymbol().getType() == HqlParser.INDEX\n\t\t\t\t&& referencedPathSource instanceof AnonymousTupleType<?> tupleType ) {\n\t\t\tif ( tupleType.findSubPathSource( CollectionPart.Nature.INDEX.getName() ) == null ) {\n\t\t\t\tthrow new FunctionArgumentException(\n\t\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\t\"The set-returning from node '%s' does not specify an index/ordinality\",\n\t\t\t\t\t\t\t\tsqmPath.getNavigablePath()\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tcheckPluralPath( sqmPath, referencedPathSource, firstNode );\n\t\t}\n\n\t\tif ( getCreationOptions().useStrictJpaCompliance() ) {\n\t\t\tfinal var attribute = (PluralPersistentAttribute<?, ?, ?>) referencedPathSource;\n\t\t\tif ( attribute.getCollectionClassification() != CollectionClassification.MAP\n\t\t\t\t\t&& firstNode.getSymbol().getType() == HqlParser.KEY ) {\n\t\t\t\tthrow new StrictJpaComplianceViolation( StrictJpaComplianceViolation.Type.KEY_FUNCTION_ON_NON_MAP );\n\t\t\t}\n\t\t}","sourceCodeStart":6040,"sourceCodeEnd":6076,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java#L6040-L6076","documentation":"Error \"The set-returning from node '%s' does not specify an index/ordinality\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A set-returning function in the from clause lacks ordinality: The set-returning from node '<value>' does not specify an index/ordinality","commonSituations":"Using unnest()/other set-returning functions in the from clause without WITH ORDINALITY where required.","solutions":["The set-returning from node requires an index/ordinality reference. Add WITH ORDINALITY / an index specification to the set-returning function in the from clause."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}