@Public public interface BatchWriteBuilder extends WriteBuilder
BatchTableWrite
and BatchTableCommit
.
Example of distributed batch writing:
// 1. Create a WriteBuilder (Serializable)
Table table = catalog.getTable(...);
WriteBuilder builder = table.newWriteBuilder();
// 2. Write records in distributed tasks
BatchTableWrite write = builder.newWrite();
write.write(...);
write.write(...);
write.write(...);
List<CommitMessage> messages = write.prepareCommit();
// 3. Collect all CommitMessages to a global node and commit
BatchTableCommit commit = builder.newCommit();
commit.commit(allCommitMessages());
Modifier and Type | Field and Description |
---|---|
static long |
COMMIT_IDENTIFIER |
Modifier and Type | Method and Description |
---|---|
BatchTableCommit |
newCommit()
Create a
TableCommit to commit CommitMessage s. |
BatchTableWrite |
newWrite()
Create a
TableWrite to write InternalRow s. |
default BatchWriteBuilder |
withOverwrite()
Overwrite writing, same as the 'INSERT OVERWRITE' semantics of SQL.
|
BatchWriteBuilder |
withOverwrite(Map<String,String> staticPartition)
Overwrite writing, same as the 'INSERT OVERWRITE T PARTITION (...)' semantics of SQL.
|
newWriteSelector, rowType, tableName
static final long COMMIT_IDENTIFIER
default BatchWriteBuilder withOverwrite()
BatchWriteBuilder withOverwrite(@Nullable Map<String,String> staticPartition)
BatchTableWrite newWrite()
TableWrite
to write InternalRow
s.newWrite
in interface WriteBuilder
BatchTableCommit newCommit()
TableCommit
to commit CommitMessage
s.newCommit
in interface WriteBuilder
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.