{"record":{"id":"986054ced504743f","repo":"prestodb/presto","slug":"not-a-valid-mode-986054","errorCode":null,"errorMessage":"not a valid mode ","messagePattern":"not a valid mode ","errorType":"exception","errorClass":"ParquetDecodingException","httpStatus":null,"severity":"error","filePath":"presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/decoders/rle/BooleanRLEValuesDecoder.java","lineNumber":122,"sourceCode":"                        remainingPackedBlock -= 8;\n                        destinationIndex += 8;\n                    }\n\n                    if (remainingPackedBlock > 0) {\n                        // read partial values from current byte until the requested length is satisfied\n                        byte inValue = localInputBuffer.get();\n                        for (int i = 0; i < remainingPackedBlock; i++) {\n                            values[destinationIndex++] = (byte) (inValue >> i & 1);\n                        }\n\n                        currentByte = inValue;\n                        currentByteOffset = remainingPackedBlock;\n                    }\n\n                    break;\n                }\n                default:\n                    throw new ParquetDecodingException(\"not a valid mode \" + mode);\n            }\n            currentCount -= numEntriesToFill;\n            remainingToCopy -= numEntriesToFill;\n        }\n    }\n\n    @Override\n    public void skip(int length)\n    {\n        int remainingToSkip = length;\n        while (remainingToSkip > 0) {\n            if (currentCount == 0) {\n                readNext();\n                if (currentCount == 0) {\n                    break;\n                }\n            }\n","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/decoders/rle/BooleanRLEValuesDecoder.java#L104-L140","documentation":"BooleanRLEValuesDecoder.readNext decodes RLE/bit-packed runs of boolean values; only Mode.RLE and Mode.PACKED_BIT_PACKED are supported. An unknown mode in a run header aborts decoding with a ParquetDecodingException naming the invalid mode. The boolean column's index stream is then unusable.","triggerScenarios":"readNext() on a boolean column encounters a run header whose mode bits are neither RLE nor PACKED_BIT_PACKED.","commonSituations":"Corrupted boolean column chunks (partial writes, transfer truncation); exotic writers using invalid hybrid headers; reading with wrong offsets after prior stream corruption.","solutions":["Run parquet-tools/parquet-cli dump on the boolean column to confirm corruption","Re-transfer the file and verify checksums","Rewrite the file with a standard Parquet writer","File a bug against presto-parquet if other engines read the same file fine"],"exampleFix":"// before: query fails on boolean column with mode=<garbage>\n// after: SELECT rewrite with standard writer\n//   INSERT INTO target SELECT bool_col, ... FROM corrupted_external\n//   (writer re-encodes with valid RLE headers)","handlingStrategy":"try-catch","validationCode":"// parquet-tools dump --column '<bool col>' file.parquet  # confirm valid RLE runs before query","typeGuard":null,"tryCatchPattern":"try {\n    decoder.readNext(count);\n} catch (ParquetDecodingException e) {\n    if (e.getMessage().startsWith(\"not a valid mode\")) {\n        // mark file as corrupt and switch to a repaired replica\n    }\n    throw e;\n}","preventionTips":["Checksum-verify Parquet files post-transfer","Prevent concurrent writers to the same file","Run parquet-tools validation during ingest","Use mainstream writers only"],"tags":["parquet","rle","boolean"],"backgroundTag":"parquet-invalid-encoding-mode","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"}