{"record":{"id":"c8295add4eb13778","repo":"prestodb/presto","slug":"error-executing-query","errorCode":null,"errorMessage":"Error executing query","messagePattern":"Error executing query","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoStatement.java","lineNumber":307,"sourceCode":"\n            // this is an update, not a query\n            while (resultSet.next()) {\n                // ignore rows\n            }\n\n            connection().updateSession(client);\n\n            Long updateCount = client.finalStatusInfo().getUpdateCount();\n            currentUpdateCount.set((updateCount != null) ? updateCount : 0);\n            currentUpdateType.set(client.finalStatusInfo().getUpdateType());\n            warningsManager.addWarnings(client.finalStatusInfo().getWarnings());\n            return false;\n        }\n        catch (ClientException e) {\n            throw new SQLException(e.getMessage(), e);\n        }\n        catch (RuntimeException e) {\n            throw new SQLException(\"Error executing query\", e);\n        }\n        finally {\n            this.statementDepth.decrementAndGet();\n            executingClient.set(null);\n            if (currentResult.get() == null) {\n                if (resultSet != null) {\n                    resultSet.close();\n                }\n                if (client != null) {\n                    client.close();\n                }\n            }\n        }\n    }\n\n    private void clearCurrentResults()\n            throws SQLException\n    {","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoStatement.java#L289-L325","documentation":"In internalExecute, any PrestoException/ClientException raised by the query client during statement execution is caught and rethrown as this SQLException with the original exception as the cause. It is a generic wrapper meaning the server-side query failed (syntax error, table missing, session error, etc.); inspect getCause() for the real reason.","triggerScenarios":"Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoStatement.java:307 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the cause (SQLException.getCause()) or the associated PrestoException error code for the underlying failure","Log the query ID from the exception to look up server-side details","Retry transient failures (e.g. connection issues) and fix SQL/schema errors permanently"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}