{"record":{"id":"d7c558a2fc5d83e0","repo":"prestodb/presto","slug":"pinot-request-generator-failure","errorCode":"PINOT_REQUEST_GENERATOR_FAILURE","errorMessage":"Unable to Jsonify request: %s","messagePattern":"Unable to Jsonify request: (.+?)","errorType":"error_code","errorClass":"PinotException","httpStatus":null,"severity":"error","filePath":"presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotBrokerPageSource.java","lineNumber":362,"sourceCode":"                rpcService = Optional.empty();\n            }\n            Request.Builder builder = Request.Builder\n                    .preparePost()\n                    .setUri(URI.create(String.format(QUERY_URL_TEMPLATE, pinotConfig.isUseSecureConnection() ? \"https\" : \"http\", queryHost)));\n            brokerAuthenticationProvider.getAuthenticationToken(session).ifPresent(token -> builder.setHeader(AUTHORIZATION, \"Basic\" + \" \" + token));\n            String body = clusterInfoFetcher.doHttpActionWithHeaders(builder, Optional.of(getRequestPayload(pinotQuery)), rpcService);\n            return populateFromQueryResults(pinotQuery, blockBuilders, types, body);\n        });\n    }\n\n    public static String getRequestPayload(PinotQueryGenerator.GeneratedPinotQuery pinotQuery)\n    {\n        ImmutableMap<String, String> pinotRequest = ImmutableMap.of(REQUEST_PAYLOAD_KEY, pinotQuery.getQuery());\n        try {\n            return OBJECT_MAPPER.writeValueAsString(pinotRequest);\n        }\n        catch (JsonProcessingException e) {\n            throw new PinotException(\n                    PINOT_REQUEST_GENERATOR_FAILURE,\n                    Optional.of(pinotQuery.getQuery()),\n                    \"Unable to Jsonify request: \" + Arrays.toString(pinotRequest.entrySet().toArray()),\n                    e);\n        }\n    }\n\n    // Set Pinot Response from query response json string.\n    @VisibleForTesting\n    public int populateFromQueryResults(\n            PinotQueryGenerator.GeneratedPinotQuery pinotQuery,\n            List<BlockBuilder> blockBuilders,\n            List<Type> types,\n            String responseJsonString)\n    {\n        String sql = pinotQuery.getQuery();\n        JsonNode jsonBody;\n        try {","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotBrokerPageSource.java#L344-L380","documentation":"Thrown when Jackson's ObjectMapper fails to serialize the Pinot request map ({\"pql\": query}) into JSON before sending it to the broker. This is nearly impossible in practice because the payload is a simple string map, but any JsonProcessingException during payload generation surfaces here.","triggerScenarios":"getRequestPayload builds ImmutableMap.of(REQUEST_PAYLOAD_KEY, pinotQuery.getQuery()) and calls OBJECT_MAPPER.writeValueAsString; JsonProcessingException from Jackson serialization (e.g. an ObjectMapper misconfigured or an I/O-backed serialization failure) triggers the throw.","commonSituations":"Custom builds with a replaced/misconfigured ObjectMapper, or exotic characters breaking serialization in patched Jackson versions.","solutions":["Inspect pinotQuery.getQuery() for malformed content; log the query string before serialization","Verify no custom Jackson ObjectMapper/module overrides break simple String-map serialization","Retry the query; if persistent, capture the query text and file an issue with the connector"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// Sanity check the query string before it is sent\nif (pinotQuery == null || pinotQuery.isEmpty()) {\n    throw new IllegalArgumentException(\"Pinot query string must not be empty\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    connector.query(sql);\n} catch (PinotException e) {\n    if (e.getErrorCode() == PinotErrorCode.PINOT_REQUEST_GENERATOR_FAILURE) {\n        // log sql and report a connector bug; not user-fixable normally\n    }\n    throw e;\n}","preventionTips":["Avoid custom ObjectMapper/module overrides in the connector classpath","Keep Jackson versions consistent across the Presto installation"],"tags":["pinot","json-serialization","jackson","request-building"],"backgroundTag":"json-serialization-failed","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}