Class FileNames

Object
io.delta.kernel.internal.util.FileNames

public final class FileNames extends Object
  • Field Details

  • Method Details

    • deltaFile

      public static String deltaFile(Path path, long version)
      Returns the delta (json format) path for a given delta file.
    • deltaVersion

      public static long deltaVersion(Path path)
      Returns the version for the given delta path.
    • deltaVersion

      public static long deltaVersion(String path)
    • checkpointVersion

      public static long checkpointVersion(Path path)
      Returns the version for the given checkpoint path.
    • checkpointVersion

      public static long checkpointVersion(String path)
    • sidecarFile

      public static String sidecarFile(Path path, String sidecar)
    • listingPrefix

      public static String listingPrefix(Path path, long version)
      Returns the prefix of all delta log files for the given version.

      Intended for use with listFrom to get all files from this version onwards. The returned Path will not exist as a file.

    • checkpointFileSingular

      public static Path checkpointFileSingular(Path path, long version)
      Returns the path for a singular checkpoint up to the given version.

      In a future protocol version this path will stop being written.

    • topLevelV2CheckpointFile

      public static Path topLevelV2CheckpointFile(Path path, long version, String uuid, String fileType)
      Returns the path for a top-level V2 checkpoint file up to the given version with a given UUID and filetype (JSON or Parquet).
    • v2CheckpointSidecarFile

      public static Path v2CheckpointSidecarFile(Path path, String uuid)
      Returns the path for a V2 sidecar file with a given UUID.
    • checkpointFileWithParts

      public static List<Path> checkpointFileWithParts(Path path, long version, int numParts)
      Returns the paths for all parts of the checkpoint up to the given version.

      In a future protocol version we will write this path instead of checkpointFileSingular.

      Example of the format: 00000000000000004915.checkpoint.0000000020.0000000060.parquet is checkpoint part 20 out of 60 for the snapshot at version 4915. Zero padding is for lexicographic sorting.

    • isCheckpointFile

      public static boolean isCheckpointFile(String fileName)
    • isClassicCheckpointFile

      public static boolean isClassicCheckpointFile(String fileName)
    • isMulitPartCheckpointFile

      public static boolean isMulitPartCheckpointFile(String fileName)
    • isV2CheckpointFile

      public static boolean isV2CheckpointFile(String fileName)
    • isCommitFile

      public static boolean isCommitFile(String fileName)
    • getFileVersion

      public static long getFileVersion(Path path)
      Get the version of the checkpoint, checksum or delta file. Throws an error if an unexpected file type is seen. These unexpected files should be filtered out to ensure forward compatibility in cases where new file types are added, but without an explicit protocol upgrade.