Package io.delta.kernel.internal.util
Class FileNames
Object
io.delta.kernel.internal.util.FileNames
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PathcheckpointFileSingular(Path path, long version) Returns the path for a singular checkpoint up to the given version.checkpointFileWithParts(Path path, long version, int numParts) Returns the paths for all parts of the checkpoint up to the given version.static longcheckpointVersion(Path path) Returns the version for the given checkpoint path.static longcheckpointVersion(String path) static PathchecksumFile(Path path, long version) Returns the path to the checksum file for the given version.static longchecksumVersion(Path path) static longchecksumVersion(String path) static StringReturns the delta (json format) path for a given delta file.static StringReturns the delta (json format) path for a given delta file.static longdeltaVersion(Path path) Returns the version for the given delta path.static longdeltaVersion(String path) static FileNames.DeltaLogFileTypedetermineFileType(FileStatus file) static longgetFileVersion(Path path) Get the version of the checkpoint, checksum or delta file.static booleanisCheckpointFile(String path) static booleanisChecksumFile(String checksumFilePath) static booleanstatic booleanisCommitFile(String path) static booleanisLogCompactionFile(String path) static booleanstatic booleanisPublishedDeltaFile(String path) static booleanisStagedDeltaFile(String path) static booleanisV2CheckpointFile(String path) static StringlistingPrefix(Path path, long version) Returns the prefix of all delta log files for the given version.static PathlogCompactionPath(Path logPath, long startVersion, long endVersion) Return the path that should be used for a log compaction file.logCompactionVersions(Path path) Returns the start and end versions for the given compaction path.logCompactionVersions(String path) static PathmultiPartCheckpointFile(Path path, long version, int part, int numParts) static StringsidecarDirectory(Path logPath) static StringsidecarFile(Path path, String sidecar) Example: /a/_sidecars/3a0d65cd-4056-49b8-937b-95f9e3ee90e5.parquetstatic StringstagedCommitDirectory(Path logPath) static StringstagedCommitFile(Path logPath, long version) static StringstagedCommitFile(String logPath, long version) static PathtopLevelV2CheckpointFile(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).static Pathv2CheckpointSidecarFile(Path path, String uuid) Returns the path for a V2 sidecar file with a given UUID.
-
Field Details
-
MULTI_PART_CHECKPOINT_FILE_PATTERN
Example: 00000000000000000001.checkpoint.0000000020.0000000060.parquet -
STAGED_COMMIT_DIRECTORY
- See Also:
-
SIDECAR_DIRECTORY
- See Also:
-
-
Method Details
-
determineFileType
-
getFileVersion
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. -
deltaVersion
Returns the version for the given delta path. -
deltaVersion
-
logCompactionVersions
Returns the start and end versions for the given compaction path. -
logCompactionVersions
-
checkpointVersion
Returns the version for the given checkpoint path. -
checkpointVersion
-
multiPartCheckpointPartAndNumParts
-
multiPartCheckpointPartAndNumParts
-
stagedCommitDirectory
-
sidecarDirectory
-
deltaFile
Returns the delta (json format) path for a given delta file. -
deltaFile
Returns the delta (json format) path for a given delta file. -
stagedCommitFile
-
stagedCommitFile
-
sidecarFile
Example: /a/_sidecars/3a0d65cd-4056-49b8-937b-95f9e3ee90e5.parquet -
checksumFile
Returns the path to the checksum file for the given version. -
checksumVersion
-
checksumVersion
-
listingPrefix
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
Returns the path for a singular checkpoint up to the given version.In a future protocol version this path will stop being written.
-
topLevelV2CheckpointFile
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
Returns the path for a V2 sidecar file with a given UUID. -
multiPartCheckpointFile
-
checkpointFileWithParts
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.
-
logCompactionPath
Return the path that should be used for a log compaction file.- Parameters:
logPath- path to the delta log locationstartVersion- the start version for the log compactionendVersion- the end version for the log compaction
-
isCheckpointFile
-
isClassicCheckpointFile
-
isMultiPartCheckpointFile
-
isV2CheckpointFile
-
isCommitFile
-
isPublishedDeltaFile
-
isStagedDeltaFile
-
isLogCompactionFile
-
isChecksumFile
-