Skip to content

= Action

Action is an <> of <> of a change to (the state of) a Delta table.

Action can be converted (serialized) to <> format for...FIXME

[[logSchema]] Action object defines logSchema that is a schema (StructType) based on the <> case class.

[source, scala]

import org.apache.spark.sql.delta.actions.Action.logSchema scala> logSchema.printTreeString 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) |-- 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) |-- 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)


[[contract]] .Action Contract (Abstract Methods Only) [cols="30m,70",options="header",width="100%"] |=== | Method | Description

| wrap a| [[wrap]]

[source, scala]

wrap: SingleAction

Wraps the action into a <> for serialization

Used when:

  • Snapshot is created (and initializes the <> for the <> of a delta table)

  • Action is requested to <>

|===

[[implementations]] [[extensions]] .Actions (Direct Implementations and Extensions Only) [cols="30,70",options="header",width="100%"] |=== | Action | Description

| <> | [[CommitInfo]]

| <> | [[FileAction]]

| <> | [[Metadata]]

| <> | [[Protocol]]

| <> | [[SetTransaction]]

|===

NOTE: Action is a Scala sealed trait which means that all the <> are in the same compilation unit (a single file).

== [[json]] Serializing to JSON Format -- json Method

[source, scala]

json: String

json simply serializes (converts) the <> to JSON format.

NOTE: json uses https://github.com/FasterXML/jackson[Jackson] library (with https://github.com/FasterXML/jackson-module-scala[jackson-module-scala]) as the JSON processor.

[NOTE]

json is used when:

  • OptimisticTransactionImpl is requested to <>

* ConvertToDeltaCommand is requested to <>

== [[fromJson]] Deserializing Action (From JSON Format) -- fromJson Utility

[source, scala]

fromJson( json: String): Action


fromJson...FIXME

[NOTE]

fromJson is used when:

  • DeltaHistoryManager utility is requested for the <>

  • DeltaLog is requested for the <>

* OptimisticTransactionImpl is requested to <>


Last update: 2020-09-24