MetadataAttribute¶
MetadataAttribute is an AttributeReference with __metadata_col internal metadata.
Creating Metadata AttributeReference¶
apply(
name: String,
dataType: DataType,
nullable: Boolean = true): AttributeReference
apply creates an AttributeReference with __metadata_col metadata (and true value).
Destructuring Metadata AttributeReference¶
unapply(
attr: AttributeReference): Option[AttributeReference]
unapply returns the given AttributeReference if contains __metadata_col metadata key with true value. Otherwise, unapply returns None (an undefined value).
unapply is used when:
FileSourceMetadataAttributeis requested to destructure an AttributeReferenceReplaceDatais requested for the dataInput
isValid¶
isValid(
metadata: Metadata): Boolean
isValid holds true when the given Metadata contains the __metadata_col entry.
isValid is used when:
RewriteMergeIntoTablelogical rule is requested tobuildWriteDeltaMergeRowsPlanRewriteUpdateTablelogical rule is requested tobuildReplaceDataUpdateProjectionandbuildDeletesAndInsertsMetadataAttributeis requested to unapplyFileSourceMetadataAttributeis requested to isValidMetadataColumnHelperis requested to isMetadataCol