Action¶
Action is an abstraction of operations (actions) that change the state of a delta table.
Contract¶
JSON Representation¶
Serializes (converts) the (wrapped) action to JSON format
Jackson
json uses Jackson library (with jackson-module-scala) as the JSON processor.
Used when:
Checkpointsis requested to writeTopLevelV2CheckpointOptimisticTransactionImplis requested to commitLarge, doCommit, validateAddFileForNullPartitions, validateAddFileNotEmptyDeltaSourceMetadataTrackingLogis requested to getMergedConsecutiveMetadataChangesPersistedMetadatais created
SingleAction Representation¶
Wraps the action into a SingleAction for serialization
See:
Used when:
Snapshotis requested to stateReconstructionActionis requested to serialize to JSON format
Implementations¶
Sealed Trait
Action is a Scala sealed trait which means that all of the implementations are in the same compilation unit (a single file).
Learn more in the Scala Language Specification.
Log Schema¶
logSchema is the schema (Spark SQL) of SingleActions for Snapshot to convert a DeltaLogFileIndex to a LogicalRelation and emptyActions.
root
|-- txn: struct (nullable = true)
| |-- appId: string (nullable = true)
| |-- version: long (nullable = false)
| |-- lastUpdated: long (nullable = true)
|-- add: struct (nullable = true)
| |-- path: string (nullable = true)
| |-- partitionValues: map (nullable = true)
| | |-- key: string
| | |-- value: string (valueContainsNull = true)
| |-- size: long (nullable = false)
| |-- modificationTime: long (nullable = false)
| |-- dataChange: boolean (nullable = false)
| |-- stats: string (nullable = true)
| |-- tags: map (nullable = true)
| | |-- key: string
| | |-- value: string (valueContainsNull = true)
|-- remove: struct (nullable = true)
| |-- path: string (nullable = true)
| |-- deletionTimestamp: long (nullable = true)
| |-- dataChange: boolean (nullable = false)
| |-- extendedFileMetadata: boolean (nullable = false)
| |-- partitionValues: map (nullable = true)
| | |-- key: string
| | |-- value: string (valueContainsNull = true)
| |-- size: long (nullable = false)
| |-- tags: map (nullable = true)
| | |-- key: string
| | |-- value: string (valueContainsNull = true)
|-- metaData: struct (nullable = true)
| |-- id: string (nullable = true)
| |-- name: string (nullable = true)
| |-- description: string (nullable = true)
| |-- format: struct (nullable = true)
| | |-- provider: string (nullable = true)
| | |-- options: map (nullable = true)
| | | |-- key: string
| | | |-- value: string (valueContainsNull = true)
| |-- schemaString: string (nullable = true)
| |-- partitionColumns: array (nullable = true)
| | |-- element: string (containsNull = true)
| |-- configuration: map (nullable = true)
| | |-- key: string
| | |-- value: string (valueContainsNull = true)
| |-- createdTime: long (nullable = true)
|-- protocol: struct (nullable = true)
| |-- minReaderVersion: integer (nullable = false)
| |-- minWriterVersion: integer (nullable = false)
|-- cdc: struct (nullable = true)
| |-- path: string (nullable = true)
| |-- partitionValues: map (nullable = true)
| | |-- key: string
| | |-- value: string (valueContainsNull = true)
| |-- size: long (nullable = false)
| |-- tags: map (nullable = true)
| | |-- key: string
| | |-- value: string (valueContainsNull = true)
|-- commitInfo: struct (nullable = true)
| |-- version: long (nullable = true)
| |-- timestamp: timestamp (nullable = true)
| |-- userId: string (nullable = true)
| |-- userName: string (nullable = true)
| |-- operation: string (nullable = true)
| |-- operationParameters: map (nullable = true)
| | |-- key: string
| | |-- value: string (valueContainsNull = true)
| |-- job: struct (nullable = true)
| | |-- jobId: string (nullable = true)
| | |-- jobName: string (nullable = true)
| | |-- runId: string (nullable = true)
| | |-- jobOwnerId: string (nullable = true)
| | |-- triggerType: string (nullable = true)
| |-- notebook: struct (nullable = true)
| | |-- notebookId: string (nullable = true)
| |-- clusterId: string (nullable = true)
| |-- readVersion: long (nullable = true)
| |-- isolationLevel: string (nullable = true)
| |-- isBlindAppend: boolean (nullable = true)
| |-- operationMetrics: map (nullable = true)
| | |-- key: string
| | |-- value: string (valueContainsNull = true)
| |-- userMetadata: string (nullable = true)
Deserializing Action (from JSON)¶
fromJson utility...FIXME
fromJson is used when:
DeltaHistoryManageris requested for CommitInfo of the given delta fileDeltaLogis requested for the changes of the given delta version and laterOptimisticTransactionImplis requested to checkForConflictsDeltaCommandis requested to commitLarge
Supported Protocol Version¶
supportedProtocolVersion(
withAllFeatures: Boolean = true,
featuresToExclude: Seq[TableFeature] = Seq.empty): Protocol
With the given withAllFeatures enabled (the default), supportedProtocolVersion takes allSupportedFeaturesMap (with the featuresToExclude excluded, if given).
In the end, supportedProtocolVersion returns this Protocol with the table features added.
supportedProtocolVersion is used when:
Actionis requested for the supportedReaderVersionNumbers and supportedWriterVersionNumbersDeltaConfigsis requested for the minimum (lowest) protocol version of the reader and writerDeltaLogis requested to assert protocol correctnessTableFeatureSupportis requested to supportedForRead and supportedForWrite