{"record":{"id":"0a7c560d769ac4fb","repo":"prestodb/presto","slug":"pinot-data-fetch-exception","errorCode":"PINOT_DATA_FETCH_EXCEPTION","errorMessage":"Encountered Pinot exceptions when fetching data table from Split: < %s >","messagePattern":"Encountered Pinot exceptions when fetching data table from Split: < (.+?) >","errorType":"error_code","errorClass":"PinotException","httpStatus":null,"severity":"error","filePath":"presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotSegmentPageSource.java","lineNumber":212,"sourceCode":"            //   - 1 metadata of the query results.\n            // So we need to check ResponseType of each ServerResponse.\n            if (serverResponseIterator.hasNext()) {\n                long startTimeNanos = System.nanoTime();\n                Server.ServerResponse serverResponse = serverResponseIterator.next();\n                readTimeNanos += System.nanoTime() - startTimeNanos;\n                final String responseType = serverResponse.getMetadataOrThrow(\"responseType\");\n                switch (responseType) {\n                    case CommonConstants.Query.Response.ResponseType.DATA:\n                        estimatedMemoryUsageInBytes = serverResponse.getSerializedSize();\n                        // Store each dataTable which will later be constructed into Pages.\n                        try {\n                            byteBuffer = serverResponse.getPayload().asReadOnlyByteBuffer();\n                            DataTable dataTable = DataTableFactory.getDataTable(byteBuffer);\n                            checkExceptions(dataTable, split, PinotSessionProperties.isMarkDataFetchExceptionsAsRetriable(session));\n                            currentDataTable = new PinotSegmentPageSource.PinotDataTableWithSize(dataTable, serverResponse.getSerializedSize());\n                        }\n                        catch (IOException e) {\n                            throw new PinotException(\n                                PINOT_DATA_FETCH_EXCEPTION,\n                                split.getSegmentPinotQuery(),\n                                String.format(\"Encountered Pinot exceptions when fetching data table from Split: < %s >\", split),\n                                e);\n                        }\n                        break;\n                    case CommonConstants.Query.Response.ResponseType.METADATA:\n                        // The last part of the response is Metadata\n                        currentDataTable = null;\n                        serverResponseIterator = null;\n                        close();\n                        return null;\n                    default:\n                        throw new PinotException(\n                            PINOT_UNEXPECTED_RESPONSE,\n                            split.getSegmentPinotQuery(),\n                            String.format(\"Encountered Pinot exceptions, unknown response type - %s\", responseType));\n                }","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotSegmentPageSource.java#L194-L230","documentation":"While reading the gRPC server response payload into a DataTable in getNextPage, an IOException means the data fetch itself failed (malformed or truncated payload, transport problem). The connector wraps it as PINOT_DATA_FETCH_EXCEPTION with the split's segment query and the cause.","triggerScenarios":"DataTableFactory.getDataTable(byteBuffer) or reading serverResponse payload throws IOException during getNextPage's response processing.","commonSituations":"Network interruptions between broker/server and Presto worker, gRPC message size limits truncating payloads, Pinot server crashes mid-response, or deserialization incompatibilities across Pinot client/server versions.","solutions":["Retry the query; this exception is classified as a data-fetch failure and may succeed on retry","Check network stability and gRPC max message size settings between Presto and Pinot","Verify Pinot broker/server and Presto connector client versions are compatible (DataTable serialization format)","Inspect Pinot server logs for crashes or oversized responses; reduce page/batch size or narrow the query to shrink the payload"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (PinotException e) {\n    if (e.getErrorCode() == PINOT_DATA_FETCH_EXCEPTION.toErrorCode().getCode()) {\n        // transient IO/grpc failure: retry with exponential backoff\n        // if persistent, check network, gRPC limits, and version compatibility\n    }\n}","preventionTips":["Use retries with backoff for data-fetch exceptions","Set gRPC max inbound message size large enough for full DataTable payloads","Keep Pinot client/server and connector versions compatible; monitor network stability"],"tags":["pinot","io-exception","grpc","data-fetch","retriable"],"backgroundTag":"pinot-data-fetch-failure","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"}