{"record":{"id":"4ac31f0db5fba49b","repo":"apache/iceberg","slug":"do-not-support-file-format-in-path-s","errorCode":null,"errorMessage":"Do not support file format in path %s","messagePattern":"Do not support file format in path (.+?)","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"delta-lake/src/main/java/org/apache/iceberg/delta/BaseSnapshotDeltaLakeTableAction.java","lineNumber":407,"sourceCode":"        spec.fields().stream()\n            .map(PartitionField::name)\n            .map(partitionValues::get)\n            .collect(Collectors.toList());\n\n    return DataFiles.builder(spec)\n        .withPath(fullFilePath)\n        .withFormat(format)\n        .withFileSizeInBytes(fileSize)\n        .withMetrics(metrics)\n        .withPartitionValues(partitionValueList)\n        .build();\n  }\n\n  private FileFormat determineFileFormatFromPath(String path) {\n    if (path.endsWith(PARQUET_SUFFIX)) {\n      return FileFormat.PARQUET;\n    } else {\n      throw new ValidationException(\"Do not support file format in path %s\", path);\n    }\n  }\n\n  private Metrics getMetricsForFile(\n      InputFile file, FileFormat format, MetricsConfig metricsSpec, NameMapping mapping) {\n    if (format == FileFormat.PARQUET) {\n      return ParquetUtil.fileMetrics(file, metricsSpec, mapping);\n    }\n    throw new ValidationException(\"Cannot get metrics from file format: %s\", format);\n  }\n\n  private Map<String, String> destTableProperties(\n      io.delta.standalone.Snapshot deltaSnapshot, String originalLocation) {\n    additionalPropertiesBuilder.putAll(deltaSnapshot.getMetadata().getConfiguration());\n    additionalPropertiesBuilder.putAll(\n        ImmutableMap.of(\n            SNAPSHOT_SOURCE_PROP, DELTA_SOURCE_VALUE, ORIGINAL_LOCATION_PROP, originalLocation));\n","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/delta-lake/src/main/java/org/apache/iceberg/delta/BaseSnapshotDeltaLakeTableAction.java#L389-L425","documentation":"determineFileFormatFromPath only recognizes paths ending in .parquet; any other file suffix found in the Delta log actions cannot be mapped to an Iceberg FileFormat and aborts with this ValidationException.","triggerScenarios":"A Delta log AddFile/RemoveFile entry whose path does not end with '.parquet' — e.g. files written with a different extension, checkpoint/metadata files wrongly passed through, or custom Delta writers using non-parquet formats.","commonSituations":"Delta tables produced by writers that used custom file extensions; migrated data retaining legacy extensions (e.g. .snappy.parquet is fine but .avro is not); accidentally including non-data entries in the action set.","solutions":["Inspect the offending path in the message; confirm whether it is a genuine data file with a non-parquet extension.","Rename/rewrite the data files with a .parquet suffix (e.g. by rewriting the Delta table) and rerun the migration.","Extend determineFileFormatFromPath to map additional extensions only if your Delta writer truly emits another format that Iceberg supports (e.g. ORC/Avro mapping to ParquetUtil equivalents).","Exclude non-data files from the action set before conversion."],"exampleFix":"// before\nthrow new ValidationException(\"Do not support file format in path %s\", path);\n// after\nif (path.endsWith(\".orc\")) {\n  return FileFormat.ORC;\n}\nthrow new ValidationException(\"Do not support file format in path %s\", path);","handlingStrategy":"validation","validationCode":"if (!addFile.getPath().endsWith(\".parquet\")) {\n  throw new IllegalStateException(\"Non-parquet Delta file: \" + addFile.getPath());\n}","typeGuard":null,"tryCatchPattern":"try {\n  snapshotTable.execute();\n} catch (ValidationException e) {\n  // parse path from message; rewrite/rename non-parquet files\n}","preventionTips":["Ensure Delta writers always emit .parquet files.","Pre-scan _delta_log AddFile paths for extensions before migration.","Don't feed non-data log entries through the action converter."],"tags":["delta-lake","file-format","validation"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}