Package io.delta.kernel.internal.actions
Class AddFile
Object
io.delta.kernel.internal.actions.RowBackedAction
io.delta.kernel.internal.actions.AddFile
Delta log action representing an `AddFile`
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StructTypeFull schema of theaddaction in the Delta Log.static final StructTypestatic final StructTypeSchema of theaddaction in the Delta Log without stats. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AddFileconvertDataFileStatus(StructType physicalSchema, URI tableRoot, DataFileStatus dataFileStatus, Map<String, Literal> partitionValues, boolean dataChange, Map<String, String> tags, Optional<Long> baseRowId, Optional<Long> defaultRowCommitVersion, Optional<DeletionVectorDescriptor> deletionVectorDescriptor) Utility to generateAddFileaction instance from the givenDataFileStatusand partition values.static RowcreateAddFileRow(StructType physicalSchema, String path, MapValue partitionValues, long size, long modificationTime, boolean dataChange, Optional<DeletionVectorDescriptor> deletionVector, Optional<MapValue> tags, Optional<Long> baseRowId, Optional<Long> defaultRowCommitVersion, Optional<DataFileStatistics> stats) Utility to generate an 'AddFile' row from the given fields.booleanbooleanlonggetPath()longgetSize()getStats(StructType physicalSchema) Returns the file statistics parsed from the stats JSON string using the provided schema.getTags()inthashCode()toRemoveFileRow(boolean dataChange, Optional<Long> deletionTimestamp) Utility to generate a 'RemoveFile' action from this AddFile action.toString()withNewBaseRowId(long baseRowId) Returns a newAddFilewith the provided baseRowId.withNewDefaultRowCommitVersion(long defaultRowCommitVersion) Returns a newAddFilewith the provided defaultRowCommitVersion.Methods inherited from class io.delta.kernel.internal.actions.RowBackedAction
toRow
-
Field Details
-
SCHEMA_WITHOUT_STATS
Schema of theaddaction in the Delta Log without stats. Used for constructing table snapshot to read data from the table. -
SCHEMA_WITH_STATS
-
FULL_SCHEMA
Full schema of theaddaction in the Delta Log.
-
-
Constructor Details
-
AddFile
-
-
Method Details
-
convertDataFileStatus
public static AddFile convertDataFileStatus(StructType physicalSchema, URI tableRoot, DataFileStatus dataFileStatus, Map<String, Literal> partitionValues, boolean dataChange, Map<String, String> tags, Optional<Long> baseRowId, Optional<Long> defaultRowCommitVersion, Optional<DeletionVectorDescriptor> deletionVectorDescriptor) Utility to generateAddFileaction instance from the givenDataFileStatusand partition values. -
createAddFileRow
public static Row createAddFileRow(StructType physicalSchema, String path, MapValue partitionValues, long size, long modificationTime, boolean dataChange, Optional<DeletionVectorDescriptor> deletionVector, Optional<MapValue> tags, Optional<Long> baseRowId, Optional<Long> defaultRowCommitVersion, Optional<DataFileStatistics> stats) Utility to generate an 'AddFile' row from the given fields. -
getPath
-
getPartitionValues
-
getSize
public long getSize() -
getModificationTime
public long getModificationTime() -
getDataChange
public boolean getDataChange() -
getDeletionVector
-
getTags
-
getStatsJson
-
getBaseRowId
-
getDefaultRowCommitVersion
-
getNumRecords
-
getStats
Returns the file statistics parsed from the stats JSON string using the provided schema. This method deserializes the statistics JSON with full type information, ensuring that min/max values and null counts are correctly typed according to the physical schema.- Parameters:
physicalSchema- the physical schema of the table, used to correctly parse and type the statistics values (min/max values and null counts)- Returns:
- an
Optionalcontaining the deserializedDataFileStatisticsif the stats field is present and non-null, orOptional.empty()otherwise - Throws:
KernelException- if the stats JSON is malformed or if values don't match the expected types from the schema- See Also:
-
withNewBaseRowId
Returns a newAddFilewith the provided baseRowId. -
withNewDefaultRowCommitVersion
Returns a newAddFilewith the provided defaultRowCommitVersion. -
toRemoveFileRow
Utility to generate a 'RemoveFile' action from this AddFile action.- Parameters:
dataChange- this will override the dataChange field in current AddFiledeletionTimestamp- the deletion timestamp of the operation, this will override the modificationTime field in current AddFile
-
toString
-
equals
-
hashCode
public int hashCode()
-