Interface SupportsOverwrite
- All Superinterfaces:
SupportsOverwriteV2
,SupportsTruncate
,WriteBuilder
Overwriting data by filter will delete any data that matches the filter and replace it with data that is committed in the write.
- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
canOverwrite
(Predicate[] predicates) Checks whether it is possible to overwrite data from a data source table that matches filter expressions.default boolean
canOverwrite
(Filter[] filters) Checks whether it is possible to overwrite data from a data source table that matches filter expressions.default WriteBuilder
Configures a write to replace data matching the filters with data committed in the write.Configures a write to replace data matching the filters with data committed in the write.default WriteBuilder
truncate()
Configures a write to replace all existing data with data committed in the write.Methods inherited from interface org.apache.spark.sql.connector.write.WriteBuilder
build, buildForBatch, buildForStreaming
-
Method Details
-
canOverwrite
Checks whether it is possible to overwrite data from a data source table that matches filter expressions.Rows should be overwritten from the data source iff all of the filter expressions match. That is, the expressions must be interpreted as a set of filters that are ANDed together.
- Parameters:
filters
- V2 filter expressions, used to match data to overwrite- Returns:
- true if the delete operation can be performed
- Since:
- 3.4.0
-
overwrite
Configures a write to replace data matching the filters with data committed in the write.Rows must be deleted from the data source if and only if all of the filters match. That is, filters must be interpreted as ANDed together.
- Parameters:
filters
- filters used to match data to overwrite- Returns:
- this write builder for method chaining
-
canOverwrite
Description copied from interface:SupportsOverwriteV2
Checks whether it is possible to overwrite data from a data source table that matches filter expressions.Rows should be overwritten from the data source iff all of the filter expressions match. That is, the expressions must be interpreted as a set of filters that are ANDed together.
- Specified by:
canOverwrite
in interfaceSupportsOverwriteV2
- Parameters:
predicates
- V2 filter expressions, used to match data to overwrite- Returns:
- true if the delete operation can be performed
-
overwrite
Description copied from interface:SupportsOverwriteV2
Configures a write to replace data matching the filters with data committed in the write.Rows must be deleted from the data source if and only if all of the filters match. That is, filters must be interpreted as ANDed together.
- Specified by:
overwrite
in interfaceSupportsOverwriteV2
- Parameters:
predicates
- filters used to match data to overwrite- Returns:
- this write builder for method chaining
-
truncate
Description copied from interface:SupportsTruncate
Configures a write to replace all existing data with data committed in the write.- Specified by:
truncate
in interfaceSupportsOverwriteV2
- Specified by:
truncate
in interfaceSupportsTruncate
- Returns:
- this write builder for method chaining
-