T
- the row typepublic interface PositionDeltaWriter<T>
extends java.io.Closeable
Modifier and Type | Method and Description |
---|---|
default void |
delete(java.lang.CharSequence path,
long pos,
PartitionSpec spec,
StructLike partition)
Deletes a position in the provided spec/partition.
|
void |
delete(java.lang.CharSequence path,
long pos,
T row,
PartitionSpec spec,
StructLike partition)
Deletes a position in the provided spec/partition and records the deleted row in the delete
file.
|
void |
insert(T row,
PartitionSpec spec,
StructLike partition)
Inserts a row to the provided spec/partition.
|
WriteResult |
result()
Returns a result that contains information about written
DataFile s or DeleteFile s. |
default void |
update(T row,
PartitionSpec spec,
StructLike partition)
Inserts a new version of an existing row to the provided spec/partition.
|
void insert(T row, PartitionSpec spec, StructLike partition)
row
- a data recordspec
- a partition specpartition
- a partition or null if the spec is unpartitioneddefault void update(T row, PartitionSpec spec, StructLike partition)
This method allows writers to distinguish new and updated records. The caller must
separately invoke delete(CharSequence, long, PartitionSpec, StructLike)
for the
original row position that is being updated.
row
- a new version of an existing rowspec
- a new partition specpartition
- a new partition or null if the spec is unpartitioneddefault void delete(java.lang.CharSequence path, long pos, PartitionSpec spec, StructLike partition)
path
- a data file pathpos
- a positionspec
- a partition specpartition
- a partition or null if the spec is unpartitionedvoid delete(java.lang.CharSequence path, long pos, T row, PartitionSpec spec, StructLike partition)
path
- a data file pathpos
- a positionrow
- a deleted rowspec
- a partition specpartition
- a partition or null if the spec is unpartitionedWriteResult result()
DataFile
s or DeleteFile
s. The result is valid only after the writer is closed.