{"record":{"id":"10a46d48c2a9fbf9","repo":"prestodb/presto","slug":"decoder-conversion-not-supported-10a46d","errorCode":"DECODER_CONVERSION_NOT_SUPPORTED","errorMessage":"start offset %s for column '%s' must be less that or equal to value length %s","messagePattern":"start offset (.+?) for column '(.+?)' must be less that or equal to value length (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-record-decoder/src/main/java/com/facebook/presto/decoder/raw/RawColumnDecoder.java","lineNumber":191,"sourceCode":"    {\n        if (!Arrays.asList(allowedFieldTypes).contains(declaredFieldType)) {\n            throw new IllegalArgumentException(format(\n                    \"Wrong dataFormat '%s' specified for column '%s'; %s type implies use of %s\",\n                    declaredFieldType.name(),\n                    columnName,\n                    columnType.getDisplayName(),\n                    Joiner.on(\"/\").join(allowedFieldTypes)));\n        }\n    }\n\n    public FieldValueProvider decodeField(byte[] value)\n    {\n        requireNonNull(value, \"value is null\");\n\n        int actualEnd = end.orElse(value.length);\n\n        if (start > value.length) {\n            throw new PrestoException(DECODER_CONVERSION_NOT_SUPPORTED, format(\n                    \"start offset %s for column '%s' must be less that or equal to value length %s\",\n                    start,\n                    columnName,\n                    value.length));\n        }\n\n        if (actualEnd > value.length) {\n            throw new PrestoException(DECODER_CONVERSION_NOT_SUPPORTED, format(\n                    \"end offset %s for column '%s' must be less that or equal to value length %s\",\n                    actualEnd,\n                    columnName,\n                    value.length));\n        }\n        return new RawValueProvider(ByteBuffer.wrap(value, start, actualEnd - start), fieldType, columnName, columnType);\n    }\n\n    private static class RawValueProvider\n            extends FieldValueProvider","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-record-decoder/src/main/java/com/facebook/presto/decoder/raw/RawColumnDecoder.java#L173-L209","documentation":"RawColumnDecoder.decodeField slices raw record bytes at [start, end). If the configured start offset exceeds the actual byte length of the record's value, there is nothing to decode, so it throws PrestoException(DECODER_CONVERSION_NOT_SUPPORTED, \"start offset %s for column '%s' must be less that or equal to value length %s\") at query time for the offending row.","triggerScenarios":"A query reads a raw-decoder column whose mapping start (e.g. '100:110') is larger than the current record's value length (e.g. 42 bytes); thrown from decodeField per-row while scanning, so one short message poisons the scan.","commonSituations":"Variable-length producer messages where some records are shorter than the assumed fixed layout; mapping offsets written for a different schema/version; compacted or truncated messages in the topic.","solutions":["Lower the column mapping offsets so they fit within the minimum message size, or lengthen/validate producer messages.","Version your tables: point a new table definition at the new message layout and query per version.","Filter out short/legacy records before decoding (e.g. via a key or header column) or fix them upstream.","If the column is nullable/optional for short rows, decode it as VARCHAR with a range within the common prefix, or preprocess with a stream job."],"exampleFix":"// before: mapping assumes >= 100-byte messages, but short records exist\n-- extra BIGINT WITH (data_format='LONG', mapping='100:108')\n// after: offsets within the guaranteed minimum record size\n-- extra BIGINT WITH (data_format='LONG', mapping='32:40')","handlingStrategy":"validation","validationCode":"void checkOffsetsFit(int start, int end, byte[] value) {\n  if (start > value.length)\n    throw new IllegalArgumentException(\"start \" + start + \" exceeds record length \" + value.length);\n}","typeGuard":null,"tryCatchPattern":"try (ResultSet rs = stmt.executeQuery(sql)) { ... } catch (SQLException e) { if (e.getMessage().contains(\"must be less that or equal to value length\")) { auditShortRecords(); } else throw e; }","preventionTips":["Guarantee a minimum record size at the producer, or lower mapping offsets to the guaranteed minimum.","Monitor topic record-size distributions; alert when p0 length < max mapping end offset.","Split old/new message layouts into separate tables/versions.","Dead-letter or pad short records upstream before ingestion."],"tags":["presto","kafka-decoder","raw","offset","data-quality"],"backgroundTag":"byte-offset-out-of-range","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"}