{"record":{"id":"05413ff83587bb34","repo":"hibernate/hibernate-orm","slug":"cockroachdb-json-table-only-support-literal-json-p","errorCode":null,"errorMessage":"CockroachDB json_table only support literal json paths, but got \" + arguments.jsonPath()","messagePattern":"CockroachDB json_table only support literal json paths, but got \" \\+ arguments\\.jsonPath\\(\\)","errorType":"exception","errorClass":"QueryException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/dialect/function/json/CockroachDBJsonTableFunction.java","lineNumber":63,"sourceCode":"\t\t\tSqlAstTranslator<?> walker) {\n\t\tif ( arguments.errorBehavior() == JsonTableErrorBehavior.NULL ) {\n\t\t\tthrow new QueryException( \"Can't emulate null on error clause on CockroachDB\" );\n\t\t}\n\t\tfinal SqlAstNode jsonPathExpression = arguments.jsonPath();\n\t\tfinal List<JsonPathHelper.JsonPathElement> jsonPathElements;\n\t\tfinal boolean isArray;\n\t\tif ( jsonPathExpression == null ) {\n\t\t\tjsonPathElements = Collections.emptyList();\n\t\t\t// Assume array by default\n\t\t\tisArray = true;\n\t\t}\n\t\telse {\n\t\t\tfinal String jsonPath;\n\t\t\ttry {\n\t\t\t\tjsonPath = walker.getLiteralValue( arguments.jsonPath() );\n\t\t\t}\n\t\t\tcatch (Exception ex) {\n\t\t\t\tthrow new QueryException( \"CockroachDB json_table only support literal json paths, but got \" + arguments.jsonPath() );\n\t\t\t}\n\t\t\tisArray = jsonPath.endsWith( \"[*]\" );\n\t\t\tif ( isArray ) {\n\t\t\t\tjsonPathElements = JsonPathHelper.parseJsonPathElements( jsonPath.substring( 0, jsonPath.length() - 3 ) );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tjsonPathElements = JsonPathHelper.parseJsonPathElements( jsonPath );\n\t\t\t}\n\t\t}\n\n\t\tsqlAppender.appendSql( \"(select\" );\n\n\t\trenderColumns( sqlAppender, arguments.columnsClause(), 0, walker );\n\n\t\tsqlAppender.appendSql( \" from \" );\n\t\tif ( isArray ) {\n\t\t\tsqlAppender.appendSql( \"jsonb_array_elements(\" );\n\t\t}","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/dialect/function/json/CockroachDBJsonTableFunction.java#L45-L81","documentation":"Error \"CockroachDB json_table only support literal json paths, but got \" + arguments.jsonPath()\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: CockroachDB json_table only support literal json paths.","commonSituations":"Common when running against a database whose dialect lacks this capability, when a mapping or HQL/Criteria query requests unsupported functionality, or when the wrong dialect is configured for the database in use. Error: CockroachDB json_table only support literal json paths.","solutions":["Pass the JSON path as a string literal."],"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"}