{"record":{"id":"c8f1804117e0ba6a","repo":"apache/druid","slug":"encountered-row-with-timestamp-s-that-cannot-be","errorCode":null,"errorMessage":"Encountered row with timestamp[%s] that cannot be represented as a long: [%s]","messagePattern":"Encountered row with timestamp\\[(.+?)\\] that cannot be represented as a long: \\[(.+?)\\]","errorType":"exception","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/data/input/impl/MapInputRowParser.java","lineNumber":173,"sourceCode":"          rawMap,\n          e,\n          \"Timestamp[%s] is unparseable! Event: %s\",\n          timeValue,\n          rawMap\n      );\n    }\n    if (timestamp == null) {\n      String rawMap = rawMapToPrint(rawMapSupplier.get());\n      throw new ParseException(\n          rawMap,\n          \"Timestamp[%s] is unparseable! Event: %s\",\n          timeValue,\n          rawMap\n      );\n    }\n    if (!Intervals.ETERNITY.contains(timestamp)) {\n      String rawMap = rawMapToPrint(rawMapSupplier.get());\n      throw new ParseException(\n          rawMap,\n          \"Encountered row with timestamp[%s] that cannot be represented as a long: [%s]\",\n          timestamp,\n          rawMap\n      );\n    }\n    return timestamp;\n  }\n\n  @Nullable\n  private static String rawMapToPrint(@Nullable Map<String, ?> rawMap)\n  {\n    if (rawMap == null) {\n      return null;\n    }\n    final String input = rawMap.toString();\n    return input.length() < 100 ? input : input.substring(0, 100) + \"...\";\n  }","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/data/input/impl/MapInputRowParser.java#L155-L191","documentation":"MapInputRowParser throws this ParseException when the parsed timestamp falls outside Intervals.ETERNITY, i.e. it cannot be represented as a Druid long (millis) timestamp - typically out-of-range values like negative or overflowing epoch millis.","triggerScenarios":"A row whose parsed timestamp is outside the representable long-millis range, so ETERNITY.contains(timestamp) is false (e.g. year 99999 or pre-minimum dates).","commonSituations":"Timestamps with extreme year values, seconds-vs-millis confusion producing huge epoch values, sentinel dates like 0001-01-01 from upstream systems.","solutions":["Sanitize or clamp outlier timestamps in a transform before parsing","Check for seconds-vs-millis unit mismatches in the source data","Reject or reroute such rows via ingestion tuning configs","Map sentinel dates to a valid range with a format parser"],"exampleFix":"// before: data '99999-01-01T00:00:00.000Z'\n// after: clamp via transformSpec\n\"transformSpec\": [{\"type\": \"expression\", \"name\": \"ts\", \"expression\": \"if TIMESTAMP_TO_MILLIS(TIME_PARSE(ts)) > 253402300799000, '9999-12-31T23:59:59.000Z', ts\"}]","handlingStrategy":"validation","validationCode":"long millis = ts.toEpochMilli(); if (millis < 0 || millis > 253402300799000L) { /* out of range */ }","typeGuard":"boolean isRepresentable(Instant t) { return t.toEpochMilli() >= 0 && t.toEpochMilli() <= 253402300799000L; }","tryCatchPattern":"try { parser.parse(row); } catch (ParseException e) { log.warn(\"Unrepresentable timestamp: {}\", e.getMessage()); }","preventionTips":["Clamp or sanitize extreme dates before parsing","Check seconds-vs-millis unit conventions at the source","Exclude sentinel dates like 0001-01-01 via transforms"],"tags":["timestamp","range","ingestion"],"backgroundTag":"value-out-of-range","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}