{"record":{"id":"15570c651baeb957","repo":"prestodb/presto","slug":"pinot-decode-error","errorCode":"PINOT_DECODE_ERROR","errorMessage":"Cannot decode double value from pinot %s","messagePattern":"Cannot decode double value from pinot (.+?)","errorType":"error_code","errorClass":"PinotException","httpStatus":null,"severity":"error","filePath":"presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotUtils.java","lineNumber":95,"sourceCode":"                return TimestampUtils.toMillisSinceEpoch(value);\n            }\n        }\n    }\n\n    public static Double parseDouble(String value)\n    {\n        try {\n            return Double.valueOf(value);\n        }\n        catch (NumberFormatException ne) {\n            switch (value) {\n                case PINOT_INFINITY:\n                case PINOT_POSITIVE_INFINITY:\n                    return PRESTO_INFINITY;\n                case PINOT_NEGATIVE_INFINITY:\n                    return PRESTO_NEGATIVE_INFINITY;\n            }\n            throw new PinotException(PINOT_DECODE_ERROR, Optional.empty(), \"Cannot decode double value from pinot \" + value, ne);\n        }\n    }\n}\n","sourceCodeStart":77,"sourceCodeEnd":99,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotUtils.java#L77-L99","documentation":"PinotUtils.parseDouble failed to convert a value returned by Pinot into a Presto double. The method special-cases NaN/infinity string tokens; any other unparseable value produces a NumberFormatException that is wrapped in this PINOT_DECODE_ERROR.","triggerScenarios":"parseTimestamp (or another caller) passes a string that parseDouble cannot parse — e.g. non-numeric timestamp text, locale-formatted numbers, empty strings, or Pinot returning 'Infinity'/'NaN' variants not in the known token list.","commonSituations":"Timestamp columns stored as strings with non-numeric formats; Pinot returning special float tokens the connector doesn't recognize; data quality issues where NULL/garbage lands in a numeric column; connector/Pinot version drift in special-value serialization.","solutions":["Inspect the offending value in the message and clean/normalize the source column data in Pinot","Cast or pre-format the column in SQL (e.g. date_trunc/CAST) so it parses as a number","Extend the special-token handling in parseDouble for the unrecognized token (e.g. 'inf', '-Infinity')","Check the timestamp format config (formatHint) for the column and fix the pattern"],"exampleFix":"// before\nthrow new PinotException(PINOT_DECODE_ERROR, Optional.empty(), \"Cannot decode double value from pinot \" + value, ne);\n// after\nif (value.equalsIgnoreCase(\"inf\") || value.equalsIgnoreCase(\"+inf\")) return PRESTO_INFINITY;\nif (value.equalsIgnoreCase(\"-inf\")) return PRESTO_NEGATIVE_INFINITY;\nthrow new PinotException(PINOT_DECODE_ERROR, Optional.empty(), \"Cannot decode double value from pinot \" + value, ne);","handlingStrategy":"validation","validationCode":"// validate the value parses before the connector sees it (source-side check)\ntry { Double.parseDouble(value); }\ncatch (NumberFormatException e) {\n  // normalize or reject at ingestion\n  value = normalizeSpecialTokens(value); // 'inf' -> 'Infinity' etc.\n}","typeGuard":null,"tryCatchPattern":"try {\n  rows = query.execute();\n} catch (PinotException e) {\n  if (PinotErrorCode.PINOT_DECODE_ERROR.toErrorCodeObject().equals(e.getErrorCode())) {\n    log.error(\"Unparseable numeric/timestamp value: %s\", e.getMessage());\n    // rerun with the column cast to VARCHAR and decode client-side\n    executeWithCast(originalQuery, offendingColumn, \"VARCHAR\");\n  } else throw e;\n}","preventionTips":["Enforce numeric/timestamp formats at Pinot ingestion time","Provide correct formatHint for timestamp columns","Check for NULL/garbage values in numeric columns with data quality queries","Extend special-token handling when Pinot serializes NaN/Infinity differently"],"tags":["pinot","decode","type-conversion","timestamp"],"backgroundTag":"value-decode-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"}