{"record":{"id":"79c2feb31814f4a1","repo":"apache/cassandra","slug":"cannot-parse-varint-value-from-s","errorCode":null,"errorMessage":"Cannot parse varint value from \"%s\"","messagePattern":"Cannot parse varint value from \"(.+?)\"","errorType":"exception","errorClass":"InvalidTypeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java","lineNumber":2067,"sourceCode":"        private static final VarintCodec instance = new VarintCodec();\n\n        private VarintCodec()\n        {\n            super(DataType.varint(), BigInteger.class);\n        }\n\n        @Override\n        public BigInteger parse(String value)\n        {\n            try\n            {\n                return value == null || value.isEmpty() || value.equalsIgnoreCase(\"NULL\")\n                       ? null\n                       : new BigInteger(value);\n            }\n            catch (NumberFormatException e)\n            {\n                throw new InvalidTypeException(\n                String.format(\"Cannot parse varint value from \\\"%s\\\"\", value), e);\n            }\n        }\n\n        @Override\n        public String format(BigInteger value)\n        {\n            if (value == null) return \"NULL\";\n            return value.toString();\n        }\n\n        @Override\n        public ByteBuffer serialize(BigInteger value, ProtocolVersion protocolVersion)\n        {\n            return value == null ? null : ByteBuffer.wrap(value.toByteArray());\n        }\n\n        @Override","sourceCodeStart":2049,"sourceCodeEnd":2085,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java#L2049-L2085","documentation":"InvalidTypeException from VarintCodec.parse: new BigInteger(value) threw NumberFormatException — the string is not a valid arbitrary-precision integer literal (non-numeric characters, malformed sign, or empty after handling of null/empty/'NULL').","triggerScenarios":"Thrown at src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2067 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply a plain optionally-signed decimal integer literal (digits only, no exponent or separators)","Strip whitespace, quotes, or locale formatting from the value","Use a value within the intended range and re-check the string encoding of the source data"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}