{"record":{"id":"eb57334c7afd23ef","repo":"MyCATApache/Mycat-Server","slug":"columnvalue-columnvalue-please-check-if-the-form-eb5733","errorCode":null,"errorMessage":"columnValue:{columnValue} Please check if the format satisfied.","messagePattern":"columnValue:(.+?) Please check if the format satisfied\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/main/java/io/mycat/route/function/PartitionByMonthAndHistory.java","lineNumber":102,"sourceCode":"        try {\n            int targetPartition;\n            Calendar curTime = Calendar.getInstance();\n            curTime.setTime(formatter.get().parse(columnValue));\n            targetPartition = ((curTime.get(Calendar.YEAR) - beginDate.get(Calendar.YEAR))\n                    * 12 + curTime.get(Calendar.MONTH)\n                    - beginDate.get(Calendar.MONTH));\n\n            /**\n             * For circulatory partition, calculated value of target partition needs to be\n             * rotated to fit the partition range\n             */\n            if (nPartition > 0) {\n                targetPartition = reCalculatePartition(targetPartition);\n            }\n            return targetPartition;\n\n        } catch (ParseException e) {\n            throw new IllegalArgumentException(new StringBuilder().append(\"columnValue:\").append(columnValue).append(\" Please check if the format satisfied.\").toString(),e);\n        }\n    }\n\n    @Override\n    public Integer[] calculateRange(String beginValue, String endValue) {\n        try {\n            int startPartition, endPartition;\n            Calendar partitionTime = Calendar.getInstance();\n            SimpleDateFormat format = new SimpleDateFormat(dateFormat);\n            partitionTime.setTime(format.parse(beginValue));\n            startPartition = ((partitionTime.get(Calendar.YEAR) - beginDate.get(Calendar.YEAR))\n                    * 12 + partitionTime.get(Calendar.MONTH)\n                    - beginDate.get(Calendar.MONTH));\n            partitionTime.setTime(format.parse(endValue));\n            endPartition = ((partitionTime.get(Calendar.YEAR) - beginDate.get(Calendar.YEAR))\n                    * 12 + partitionTime.get(Calendar.MONTH)\n                    - beginDate.get(Calendar.MONTH));\n","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/MyCATApache/Mycat-Server/blob/65f8d8beb752f935752f2a0eec0ab017facab9ef/src/main/java/io/mycat/route/function/PartitionByMonthAndHistory.java#L84-L120","documentation":"PartitionByMonthAndHistory.calculate() parses the column value as a date (SimpleDateFormat) to compute a month partition with history-aware recalculation (reCalculatePartition). On ParseException it throws this IllegalArgumentException. The column value must be a date string in the configured format.","triggerScenarios":"calculate() receiving a value that fails date parsing: format mismatch with the rule's dateFormat, empty/null string, or non-date text; history partition routing of migrated rows with nonstandard date formats.","commonSituations":"History-month sharding where legacy data uses a different date format than new data; applications formatting dates per locale; timezone-adjusted strings with offsets not matching the pattern.","solutions":["Make all column values conform to the configured dateFormat (reformat legacy data if needed).","Update the dateFormat property to the dominant data format.","Add pre-insert validation that the value parses with the same SimpleDateFormat before sending to Mycat."],"exampleFix":"// before (mixed formats in data)\nINSERT INTO t(id, d) VALUES(1, '2024-1-5');\n// after\nINSERT INTO t(id, d) VALUES(1, '2024-01-05');","handlingStrategy":"validation","validationCode":"boolean valid;\ntry {\n  new java.text.SimpleDateFormat(dateFormat).parse(columnValue);\n  valid = true;\n} catch (java.text.ParseException e) { valid = false; }\n","typeGuard":null,"tryCatchPattern":"try {\n    Integer node = partitionByMonthAndHistory.calculate(columnValue);\n} catch (IllegalArgumentException e) {\n    // malformed date for history-month routing; quarantine row and log value\n}","preventionTips":["Migrate legacy rows to the canonical date format before enabling the rule","Validate dates in ETL pipelines with the same pattern","Keep one shared date-formatter utility across services"],"tags":["sharding","date-format","parsing"],"backgroundTag":"invalid-date-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"}