apache/flink · error · FileNotFoundException

JAR file is not a file: {}

Error message

JAR file is not a file: {}

What it means

Thrown from ParquetDataColumnReaderFactory's double-typed reader (DoubleBaseVector or DoubleDataFrameReader) when readTimestamp() is called on it — the DOUBLE reader implements every method of ParquetDataColumnReader but timestamps, which it hard-rejects. It signals the dispatch logic routed a timestamp read to a reader constructed for DOUBLE physical data, i.e. a physical-type/logical-type mismatch.

Source

Thrown at flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java:1072

                .setSavepointRestoreSettings(runOptions.getSavepointRestoreSettings())
                .setArguments(programArgs)
                .build();
    }

    /**
     * Gets the JAR file from the path.
     *
     * @param jarFilePath The path of JAR file
     * @return The JAR file
     * @throws FileNotFoundException The JAR file does not exist.
     */
    private File getJarFile(String jarFilePath) throws FileNotFoundException {
        File jarFile = new File(jarFilePath);
        // Check if JAR file exists
        if (!jarFile.exists()) {
            throw new FileNotFoundException("JAR file does not exist: " + jarFile);
        } else if (!jarFile.isFile()) {
            throw new FileNotFoundException("JAR file is not a file: " + jarFile);
        }
        return jarFile;
    }

    // --------------------------------------------------------------------------------------------
    //  Logging and Exception Handling
    // --------------------------------------------------------------------------------------------

    /**
     * Displays an exception message for incorrect command line arguments.
     *
     * @param e The exception to display.
     * @return The return code for the process.
     */
    private static int handleArgException(CliArgsException e) {
        LOG.error("Invalid command line arguments.", e);

        System.out.println(e.getMessage());

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Check the Parquet physical type of the timestamp column (`parquet-tools schema`) and align the Flink schema to it (DOUBLE) or rewrite the file with INT64/millis timestamps
  2. If the file legitimately stores epoch doubles, declare the column DOUBLE in Flink and cast to TIMESTAMP in SQL
  3. Re-create the table/files so the timestamp annotation matches one of the supported physical mappings (INT64 with unit annotation, INT96)
  4. Never mix schema versions where a column flips between DOUBLE and TIMESTAMP without rewriting the data

Example fix

-- before: file column is DOUBLE, schema says TIMESTAMP
CREATE TABLE t (ts TIMESTAMP(3)) WITH ('format'='parquet', ...);

-- after: read as DOUBLE, cast at query time
CREATE TABLE t (ts_raw DOUBLE) WITH ('format'='parquet', ...);
SELECT CAST(ts_raw * 1000 AS TIMESTAMP(3)) FROM t;
Defensive patterns

Strategy: type-guard

Validate before calling

// Before reading, confirm the physical type backs the logical TIMESTAMP
MessageType fileSchema = ParquetFileReader.readFooter(conf, path).getFileMetaData().getSchema();
PrimitiveType pt = (PrimitiveType) fileSchema.getType(parquetColumnName);
if (pt.getPrimitiveTypeName() == PrimitiveType.PrimitiveTypeName.DOUBLE) {
    // map the column to DOUBLE in the Flink schema, not TIMESTAMP
}

Type guard

static boolean physicalTypeSupportsTimestamp(PrimitiveType t) {
    return t.getPrimitiveTypeName() == INT64
        || t.getPrimitiveTypeName() == INT96;
}

Try / catch

try {
    vectorizedReader.readToVector(...);
} catch (RuntimeException e) {
    if ("Unsupported operation".equals(e.getMessage())
            && ExceptionUtils.indexOfThrowable(e, RuntimeException.class) >= 0) {
        // verify physical vs logical type alignment before proceeding
    } else throw e;
}

Prevention

When it happens

Trigger: A column declared TIMESTAMP in the Flink schema whose Parquet physical type is DOUBLE (writer stored epoch-millis/seconds as double); type-mapping tables in ParquetRowConverter ParquetDataColumnReaderFactory mapping a logical timestamp onto the double reader; inconsistent schemas after evolution.

Common situations: Reading files written by systems that store timestamps as floating-point epochs; schema evolution where a column changed type between writes; misconfigured Flink Parquet table schemas not matching the file's physical types.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/da6f8b1d48ff0fc4. Report an issue: GitHub.