{"record":{"id":"562d7195f7106d2e","repo":"pentaho/pentaho-kettle","slug":"the-default-value-defaultvalue-should-be-of-format-562d71","errorCode":null,"errorMessage":"The default value \" + defaultValue + \" should be of format : \" + ValueMetaBase.DEFAULT_TIMESTAMP_PARSE_MASK","messagePattern":"The default value \" \\+ defaultValue \\+ \" should be of format : \" \\+ ValueMetaBase\\.DEFAULT_TIMESTAMP_PARSE_MASK","errorType":"exception","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/output/PentahoAvroOutputFormat.java","lineNumber":345,"sourceCode":"   * <P>\n   *  ValueMetaBase.DEFAULT_TIMESTAMP_PARSE_MASK is the default timestamp parser used for\n   *  Avro To PDI and vice-versa conversions.\n   * @see PentahoAvroRecordWriter#createAvroRecord\n   * </P>\n   *\n   * <p>\n   * @param defaultValue The default value provided.\n   * @return The long value of converted default value to Date and Time.\n   */\n  private long getTimeStampTypeForDefaultValue( String defaultValue ) throws ParseException {\n    Date defaultTimeStamp;\n    DateFormat dateFormat = new SimpleDateFormat( ValueMetaBase.DEFAULT_TIMESTAMP_PARSE_MASK );\n\n    try {\n      defaultTimeStamp = dateFormat.parse( defaultValue );\n      return defaultTimeStamp.getTime();\n    } catch ( ParseException pe ) {\n      throw new ParseException( \"The default value \" + defaultValue + \" should be of format : \" + ValueMetaBase.DEFAULT_TIMESTAMP_PARSE_MASK, pe.getErrorOffset() );\n    }\n  }\n}\n\n","sourceCodeStart":327,"sourceCodeEnd":350,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/output/PentahoAvroOutputFormat.java#L327-L350","documentation":"ParseException re-thrown by PentahoAvroOutputFormat.getTimeStampTypeForDefaultValue when the default value string cannot be parsed using ValueMetaBase.DEFAULT_TIMESTAMP_PARSE_MASK. The method converts a timestamp string to epoch milliseconds for TIMESTAMP_MILLIS-typed Avro fields.","triggerScenarios":"mapDefaultValuesToDataTypes dispatches a TIMESTAMP_MILLIS field to getTimeStampTypeForDefaultValue and the SimpleDateFormat with DEFAULT_TIMESTAMP_PARSE_MASK fails on the string — wrong format, empty value, or invalid date/time components.","commonSituations":"Entering only a date ('2024/12/31') without the time portion; using ISO-8601 with 'T' separators ('2024-12-31T10:15:00') when the mask expects space separators; timezone suffixes like 'Z' not accepted by the mask; defaults migrated from other tooling with different conventions.","solutions":["Set the default value to match ValueMetaBase.DEFAULT_TIMESTAMP_PARSE_MASK exactly (e.g. '2024/12/31 10:15:00')","Pre-parse the timestamp with a flexible parser and reformat into the expected mask before configuring the field","Strip timezone suffixes or convert to the expected textual format","Leave the default empty/null if the field has no required default","Use the reported error offset to locate the offending character in the value"],"exampleFix":"// before\nfield.setDefault( \"2024-12-31T10:15:00Z\" );\n// after\nfield.setDefault( \"2024/12/31 10:15:00\" ); // matches DEFAULT_TIMESTAMP_PARSE_MASK","handlingStrategy":"validation","validationCode":"String MASK = org.pentaho.di.compatibility.ValueMetaBase.DEFAULT_TIMESTAMP_PARSE_MASK;\nnew java.text.SimpleDateFormat( MASK ).parse( defaultValue ); // throws ParseException if not in mask","typeGuard":"boolean isValidTimestampDefault( String v ) { try { new java.text.SimpleDateFormat( \"yyyy/MM/dd HH:mm:ss\" ).parse( v ); return true; } catch ( ParseException e ) { return false; } }","tryCatchPattern":"try { long epochMillis = getTimeStampTypeForDefaultValue( defaultValue ); }\ncatch ( ParseException pe ) { throw new IllegalArgumentException( \"Use format yyyy/MM/dd HH:mm:ss for timestamp defaults: \" + defaultValue ); }","preventionTips":["Include both date and time parts for TIMESTAMP_MILLIS defaults","Pre-convert ISO-8601 or epoch inputs into yyyy/MM/dd HH:mm:ss before configuring","Avoid timezone suffixes in default strings; the mask has no TZ pattern","Test the default in a small transformation before promoting it to production"],"tags":["avro","timestamp","parsing","default-value"],"backgroundTag":"invalid-date-format","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}