Skip to content

AddFile

AddFile is a FileAction that represents an action of adding a new file to a delta table.

Creating Instance

AddFile takes the following to be created:

AddFile is created when:

dataChange

FileAction
dataChange: Boolean

dataChange is part of the FileAction abstraction.

AddFile is given dataChange flag when created.

dataChange is enabled (true) when:

dataChange is disabled (false) when:

dataChange can also be specified when:

File Statistics

stats: String

AddFile can be given a JSON-encoded file statistics when created.

The statistics are undefined (null) by default.

The statistics can be defined when:

stats is used when:

numLogicalRecords

Signature
numLogicalRecords: Option[Long]

numLogicalRecords is part of the FileAction abstraction.

numLogicalRecords is numLogicalRecords from the parsedStatsFields, if available.

Lazy Value

numLogicalRecords is a Scala lazy value to guarantee that the code to initialize it is executed once only (when accessed for the first time) and the computed value never changes afterwards.

Learn more in the Scala Language Specification.

parsedStatsFields

parsedStatsFields: Option[ParsedStatsFields]

parsedStatsFields takes the value of numRecords in the stats, if available, minus the numDeletedRecords.

Lazy Value

parsedStatsFields is a Scala lazy value to guarantee that the code to initialize it is executed once only (when accessed for the first time) and the computed value never changes afterwards.

Learn more in the Scala Language Specification.

Converting to SingleAction

wrap: SingleAction

wrap is part of the Action abstraction.

wrap creates a new SingleAction with the add field set to this AddFile.

Converting to RemoveFile with Defaults

remove: RemoveFile

remove creates a RemoveFile for the path (with the current time and dataChange flag enabled).

remove is used when:

Converting to RemoveFile

removeWithTimestamp(
  timestamp: Long = System.currentTimeMillis(),
  dataChange: Boolean = true): RemoveFile

remove creates a new RemoveFile action for the path with the given timestamp and dataChange flag.

dataChange Flag is Disabled for OptimizeTableCommand

dataChange is true (enabled) by default.

dataChange can only be changed (to false) when:

It is only OptimizeTableCommand that explicitly turns dataChange off (false).

removeWithTimestamp is used when:

removeRows

removeRows(
  deletionVector: DeletionVectorDescriptor,
  updateStats: Boolean,
  dataChange: Boolean = true): (AddFile, RemoveFile)

removeRows...FIXME


removeRows is used when:

tag

tag(
  tag: AddFile.Tags.KeyType): Option[String]

tag gets the value of the given tag.


tag is used when:

  • AddFile is requested for an insertionTime (that does not seem to be used anywhere)

numLogicalRecords

Signature
numLogicalRecords: Option[Long]

numLogicalRecords is part of the FileAction abstraction.

Lazy Value

numLogicalRecords is a Scala lazy value to guarantee that the code to initialize it is executed once only (when accessed for the first time) and the computed value never changes afterwards.

Learn more in the Scala Language Specification.

numLogicalRecords is parsedStatsFields.


numLogicalRecords is used when: