Package io.delta.kernel.internal.actions
Class CommitInfo
Object
io.delta.kernel.internal.actions.CommitInfo
Delta log action representing a commit information action. According to the Delta protocol there
isn't any specific schema for this action, but we use the following schema:
- inCommitTimestamp: Long - A monotonically increasing timestamp that represents the time since epoch in milliseconds when the commit write was started
- timestamp: Long - Milliseconds since epoch UTC of when this commit happened
- engineInfo: String - Engine that made this commit
- operation: String - Operation (e.g. insert, delete, merge etc.)
- operationParameters: Map(String, String) - each operation depending upon the type may add zero or more parameters about the operation. E.g. when creating a table `partitionBy` key with list of partition columns is added.
- isBlindAppend: Boolean - Is this commit a blind append?
- txnId: String - a unique transaction id of this commit
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longextractRequiredIctFromCommitInfoOpt(Optional<CommitInfo> commitInfoOpt, long version, Path dataPath) Returns the `inCommitTimestamp` of the given `commitInfoOpt` if it is defined.static CommitInfofromColumnVector(ColumnVector vector, int rowId) static longgetRequiredIctFromDeltaFile(Engine engine, Path tablePath, FileStatus deltaFileStatus, long version) Returns the `inCommitTimestamp` of the provided delta file.longgetTxnId()voidsetInCommitTimestamp(Optional<Long> inCommitTimestamp) toRow()Encode as aRowobject with the schemaFULL_SCHEMA.static Optional<CommitInfo> tryReadCommitInfoFromDeltaFile(Engine engine, FileStatus deltaFileStatus) Read the CommitInfo action (if available) from the given delta file.static longunsafeGetRequiredIctFromPublishedDeltaFile(Engine engine, Path logPath, long version) Returns the `inCommitTimestamp` of delta file at the requested version.static Optional<CommitInfo> unsafeTryReadCommitInfoFromPublishedDeltaFile(Engine engine, Path logPath, long version) Get the CommitInfo action (if available) from the delta file at the given logPath and version.
-
Field Details
-
FULL_SCHEMA
-
-
Constructor Details
-
CommitInfo
-
-
Method Details
-
fromColumnVector
-
unsafeGetRequiredIctFromPublishedDeltaFile
public static long unsafeGetRequiredIctFromPublishedDeltaFile(Engine engine, Path logPath, long version) Returns the `inCommitTimestamp` of delta file at the requested version. Throws an exception if the delta file does not exist or does not have a commitInfo action or if the commitInfo action contains an empty `inCommitTimestamp`.WARNING: UNSAFE METHOD because this assumes that 00N.json is published.
-
getRequiredIctFromDeltaFile
public static long getRequiredIctFromDeltaFile(Engine engine, Path tablePath, FileStatus deltaFileStatus, long version) Returns the `inCommitTimestamp` of the provided delta file. Throws an exception if the delta file does not exist or does not have a commitInfo action or if the commitInfo action contains an empty `inCommitTimestamp`. The delta file can be either a published or staged commit file. -
extractRequiredIctFromCommitInfoOpt
public static long extractRequiredIctFromCommitInfoOpt(Optional<CommitInfo> commitInfoOpt, long version, Path dataPath) Returns the `inCommitTimestamp` of the given `commitInfoOpt` if it is defined. Throws an exception if `commitInfoOpt` is empty or contains an empty `inCommitTimestamp`. -
unsafeTryReadCommitInfoFromPublishedDeltaFile
public static Optional<CommitInfo> unsafeTryReadCommitInfoFromPublishedDeltaFile(Engine engine, Path logPath, long version) Get the CommitInfo action (if available) from the delta file at the given logPath and version.WARNING: UNSAFE METHOD because this assumes that 00N.json is published.
-
tryReadCommitInfoFromDeltaFile
public static Optional<CommitInfo> tryReadCommitInfoFromDeltaFile(Engine engine, FileStatus deltaFileStatus) Read the CommitInfo action (if available) from the given delta file. -
getTimestamp
public long getTimestamp() -
getEngineInfo
-
getOperation
-
getOperationParameters
-
getIsBlindAppend
-
getTxnId
-
getInCommitTimestamp
-
getOperationMetrics
-
setInCommitTimestamp
-
toRow
Encode as aRowobject with the schemaFULL_SCHEMA.- Returns:
Rowobject with the schemaFULL_SCHEMA
-