{"record":{"id":"be1481349a79b1a2","repo":"prestodb/presto","slug":"invalid-float-value","errorCode":null,"errorMessage":"Invalid float value","messagePattern":"Invalid float value","errorType":"exception","errorClass":"RcFileCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-rcfile/src/main/java/com/facebook/presto/rcfile/text/FloatEncoding.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.writeLong(builder, Float.floatToIntBits(parseFloat(slice, offset, length)));\n    }\n\n    private static float parseFloat(Slice slice, int start, int length)\n            throws RcFileCorruptionException\n    {\n        try {\n            return Float.parseFloat(slice.toStringAscii(start, length));\n        }\n        catch (NumberFormatException e) {\n            throw new RcFileCorruptionException(e, \"Invalid float 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/FloatEncoding.java#L85-L107","documentation":"TextEncoding for REAL/FLOAT parses ASCII bytes with Float.parseFloat. Non-numeric bytes raise NumberFormatException, rethrown as RcFileCorruptionException('Invalid float value') since well-formed RCFile text data must contain parseable floats.","triggerScenarios":"decodeColumn/decodeValueInto on a text-encoded REAL column encountering bytes outside float literal syntax — misparsed fields, wrong separators, or binary garbage in the column.","commonSituations":"Column type mismatch between Presto schema and file contents; misconfigured regex/serde separators; files written by other tools with different text formatting; corrupted data.","solutions":["Confirm the declared column type matches what the writer encoded","Fix separator/encoding configuration so fields are split correctly","Regenerate or repair the corrupted file from source data","Catch RcFileCorruptionException and handle the corrupt row/file explicitly"],"exampleFix":"// before: value 'abc' in a REAL column\n// after: write '1.5' or change the column type to varchar","handlingStrategy":"try-catch","validationCode":"// verify bytes parse as float before decode\nSlice v = ...;\ntry { Float.parseFloat(v.toStringAscii()); } catch (NumberFormatException e) { /* corrupt field */ }","typeGuard":null,"tryCatchPattern":"try { float f = floatEncoding.decodeColumn(columnData).getFloat(pos); }\ncatch (RcFileCorruptionException e) {\n    if (e.getMessage().contains(\"Invalid float\")) {\n        handleCorruptField(e);\n    } else { throw e; }\n}","preventionTips":["Match declared REAL column types with writer-side types","Validate text field delimiters so numeric fields are not split","Regenerate files whose source data was hand-modified","Sample-read new files to catch schema drift before large queries"],"tags":["rcfile","text-encoding","float","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"}