apache/seatunnel · error · IllegalArgumentException

Failed to parse file modified date format: yyyy-MM-dd HH:mm:

Error message

Failed to parse file modified date format: yyyy-MM-dd HH:mm:ss, please check file_filter_modified_start or file_filter_modified_end format.

What it means

File modified-time filtering (file_filter_modified_start / file_filter_modified_end) accepts dates only in the fixed pattern 'yyyy-MM-dd HH:mm:ss'. When SimpleDateFormat cannot parse the supplied string, the enumerator throws an IllegalArgumentException with this message. There is no lenient alternate format; the value must match the pattern exactly.

Source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/ContinuousMultipleTableFileSourceSplitEnumerator.java:2014

        @Override
        public void close() throws IOException {
            if (!shareTargetFs && targetFs != null) {
                targetFs.close();
            }
            if (sourceFs != null) {
                sourceFs.close();
            }
        }

        private static Date parseModifiedDate(String modifiedDate) {
            if (modifiedDate == null) {
                return null;
            }
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            try {
                return dateFormat.parse(modifiedDate);
            } catch (ParseException e) {
                throw new IllegalArgumentException(
                        "Failed to parse file modified date format: yyyy-MM-dd HH:mm:ss, please check file_filter_modified_start or file_filter_modified_end format.");
            }
        }
    }

    private static HadoopConf buildTargetHadoopConf(
            HadoopConf sourceConf, String targetPath, Map<String, String> targetHadoopConf) {
        Map<String, String> extraOptions =
                targetHadoopConf == null
                        ? new LinkedHashMap<>()
                        : new LinkedHashMap<>(targetHadoopConf);

        String fsDefaultNameKey = sourceConf.getFsDefaultNameKey();
        String targetDefaultFs = extraOptions.remove(fsDefaultNameKey);

        if (StringUtils.isBlank(targetDefaultFs)) {
            targetDefaultFs = tryDeriveDefaultFsFromPath(targetPath);
        }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Rewrite the filter values as 'yyyy-MM-dd HH:mm:ss', e.g. '2024-01-01 00:00:00'.
  2. If converting from ISO-8601, drop the 'T' and trailing timezone: '2024-01-01T00:00:00Z' -> '2024-01-01 00:00:00'.
  3. Validate the string with SimpleDateFormat in a quick local test before running the job.
  4. Keep both start and end in the same exact format.

Example fix

// before
file_filter_modified_start = "2024-01-01T00:00:00Z"
// after
file_filter_modified_start = "2024-01-01 00:00:00"
Defensive patterns

Strategy: validation

Validate before calling

new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(fileFilterModifiedStart); // throws if invalid

Type guard

boolean isValidModifiedDate(String s) { try { new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(s); return true; } catch (ParseException e) { return false; } }

Try / catch

try { dateFormat.parse(value); } catch (ParseException e) { throw new IllegalArgumentException("file_filter_modified_* must use yyyy-MM-dd HH:mm:ss", e); }

Prevention

When it happens

Trigger: A user supplies file_filter_modified_start or file_filter_modified_end in a different format, e.g. '2024-01-01', ISO-8601 '2024-01-01T00:00:00', '01/01/2024', or with timezone suffixes; dateFormat.parse throws ParseException and is wrapped in IllegalArgumentException.

Common situations: Using dates copied from log files or JSON APIs (ISO format); forgetting the time component; locale-dependent date strings; typos like two-digit years or wrong separators.

Understand the failure class

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/07aa8e236eb480eb. Report an issue: GitHub.