{"record":{"id":"f35d7a05840cf57b","repo":"MyCATApache/Mycat-Server","slug":"columnvalue-columnvalue-please-eliminate-any-quo","errorCode":null,"errorMessage":"columnValue:{columnValue} Please eliminate any quote and non number within it.","messagePattern":"columnValue:(.+?) Please eliminate any quote and non number within it\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/main/java/io/mycat/route/function/PartitionByLong.java","lineNumber":65,"sourceCode":"\tpublic void setPartitionLength(String partitionLength) {\r\n\t\tthis.length = toIntArray(partitionLength);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void init() {\r\n\t\tpartitionUtil = new PartitionUtil(count, length);\r\n\r\n\t}\r\n\r\n\t@Override\r\n\tpublic Integer calculate(String columnValue)  {\r\n//\t\tcolumnValue = NumberParseUtil.eliminateQoute(columnValue);\r\n\t\ttry {\r\n\t\t\tlong key = Long.parseLong(columnValue);\r\n\t\t\tkey = (key >>> 32) ^ key;\r\n\t\t\treturn partitionUtil.partition(key);\r\n\t\t} catch (NumberFormatException e){\r\n\t\t\tthrow new IllegalArgumentException(new StringBuilder().append(\"columnValue:\").append(columnValue).append(\" Please eliminate any quote and non number within it.\").toString(),e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t@Override\r\n\tpublic Integer[] calculateRange(String beginValue, String endValue)  {\r\n\t\treturn AbstractPartitionAlgorithm.calculateSequenceRange(this, beginValue, endValue);\r\n\t}\r\n\r\n//\t@Override\r\n//\tpublic int getPartitionCount() {\r\n//\t\tint nPartition = 0;\r\n//\t\tfor(int i = 0; i < count.length; i++) {\r\n//\t\t\tnPartition += count[i];\r\n//\t\t}\r\n//\t\treturn nPartition;\r\n//\t}\r\n\t\r\n}","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/MyCATApache/Mycat-Server/blob/65f8d8beb752f935752f2a0eec0ab017facab9ef/src/main/java/io/mycat/route/function/PartitionByLong.java#L47-L83","documentation":"PartitionByLong.calculate() parses the column value with Long.parseLong() to compute the partition via a long-range partition utility. On NumberFormatException it throws this IllegalArgumentException telling you to remove quotes and non-numeric characters. Only 64-bit-range integer strings are accepted.","triggerScenarios":"Routing a row whose integer-partition column is non-numeric, quoted (e.g. \"123\"), exceeds Long range, is empty, or contains separators like commas or spaces; note the quote-elimination call is commented out in this version.","commonSituations":"Applications sending numbers as quoted strings; values with thousands separators ('1,000,000'); float strings ('3.14') or very long ids beyond Long.MAX_VALUE.","solutions":["Send the column value as a plain integer string within Long range (no quotes, commas, or spaces).","Re-enable NumberParseUtil.eliminateQoute(columnValue) in calculate() if quoted data is expected.","Clean the data at the application/ETL layer before insert; use a Long-parseable type for the column."],"exampleFix":"// before (in PartitionByLong.calculate)\n// columnValue = NumberParseUtil.eliminateQoute(columnValue);\nlong key = Long.parseLong(columnValue);\n// after\ncolumnValue = NumberParseUtil.eliminateQoute(columnValue);\nlong key = Long.parseLong(columnValue);","handlingStrategy":"validation","validationCode":"boolean ok;\ntry { Long.parseLong(columnValue.trim()); ok = true; }\ncatch (NumberFormatException e) { ok = false; }\n","typeGuard":null,"tryCatchPattern":"try {\n    Integer node = partitionByLong.calculate(columnValue);\n} catch (IllegalArgumentException e) {\n    // value not Long-parseable: log and reject or sanitize (strip quotes) then retry\n}","preventionTips":["Use BIGINT typed columns for integer sharding keys","Eliminate quotes at the driver/app layer since this version's eliminateQoute is commented out","Guard against values beyond Long.MAX_VALUE"],"tags":["sharding","number-format","parsing"],"backgroundTag":"invalid-argument-format","analyzedSha":"65f8d8beb752f935752f2a0eec0ab017facab9ef","analyzedAt":"2026-09-11T00:12:21.696Z","contentChangedAt":"2026-09-11T00:12:21.696Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}