{"record":{"id":"7f9d59f00df9ec08","repo":"prestodb/presto","slug":"invalid-double-value","errorCode":null,"errorMessage":"Invalid double value","messagePattern":"Invalid double value","errorType":"exception","errorClass":"RcFileCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-rcfile/src/main/java/com/facebook/presto/rcfile/text/DoubleEncoding.java","lineNumber":103,"sourceCode":"        }\n        return builder.build();\n    }\n\n    @Override\n    public void decodeValueInto(int depth, BlockBuilder builder, Slice slice, int offset, int length)\n            throws RcFileCorruptionException\n    {\n        type.writeDouble(builder, parseDouble(slice, offset, length));\n    }\n\n    private static double parseDouble(Slice slice, int start, int length)\n            throws RcFileCorruptionException\n    {\n        try {\n            return Double.parseDouble(slice.toStringAscii(start, length));\n        }\n        catch (NumberFormatException e) {\n            throw new RcFileCorruptionException(e, \"Invalid double value\");\n        }\n    }\n}\n","sourceCodeStart":85,"sourceCodeEnd":107,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-rcfile/src/main/java/com/facebook/presto/rcfile/text/DoubleEncoding.java#L85-L107","documentation":"TextEncoding for DOUBLE parses ASCII text from the RCFile column using Double.parseDouble. If the bytes are not a valid double literal, the NumberFormatException is rethrown as RcFileCorruptionException('Invalid double value'), because a valid RCFile written by Hive should only contain parseable doubles.","triggerScenarios":"decodeColumn/decodeValueInto reading a text-encoded DOUBLE column whose bytes (from start, length) are non-numeric — garbage bytes, misaligned field boundaries, or wrong column type mapping.","commonSituations":"Schema drift: column declared DOUBLE in Presto but written as another type/text; wrong field/separator configuration; corrupted or hand-edited text files; charset/binary data landing in a double column.","solutions":["Verify the table schema matches the actual data written in the file","Check the RCFile text encoding/separator configuration matches the writer","Inspect the offending bytes and fix or regenerate the source file","Catch RcFileCorruptionException per column and treat the value/file as corrupt (skip row or fail query with a clear message)"],"exampleFix":"// before: schema says double but file has text like '1,23'\n// after: fix data to '1.23' or change column type to varchar","handlingStrategy":"try-catch","validationCode":"// verify bytes parse as double before decode path is exercised\nSlice v = ...;\ntry { Double.parseDouble(v.toStringAscii()); } catch (NumberFormatException e) { /* corrupt field */ }","typeGuard":null,"tryCatchPattern":"try { double d = doubleEncoding.decodeColumn(columnData).getDouble(pos); }\ncatch (RcFileCorruptionException e) {\n    if (e.getMessage().contains(\"Invalid double\")) {\n        handleCorruptField(e); // skip row, null value, or fail with path info\n    } else { throw e; }\n}","preventionTips":["Keep table schema in sync with the data actually written by Hive","Validate separator/escape configuration matches the writer","Checksum files after production; avoid hand-edited data files","Detect corrupt rows early with a small sample read before full scans"],"tags":["rcfile","text-encoding","double","parse-error"],"backgroundTag":"invalid-numeric-value","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"}