Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cdc] Combine mode should throw better exception to dynamic bucket table #3291

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.apache.paimon.catalog.Catalog;
import org.apache.paimon.catalog.Identifier;
import org.apache.paimon.table.BucketMode;
import org.apache.paimon.table.FileStoreTable;
import org.apache.paimon.table.sink.ChannelComputer;

Expand Down Expand Up @@ -77,6 +78,14 @@ private ChannelComputer<CdcRecord> computeChannelComputer(CdcMultiplexRecord rec
LOG.error("Failed to get table " + id.getFullName());
return null;
}

if (table.bucketMode() != BucketMode.FIXED) {
throw new UnsupportedOperationException(
String.format(
"Combine mode Sink only supports FIXED bucket mode, but %s is %s",
table.name(), table.bucketMode()));
}

CdcRecordChannelComputer channelComputer =
new CdcRecordChannelComputer(table.schema());
channelComputer.setup(numChannels);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ private FileStoreTable getTable(Identifier tableId) throws InterruptedException

if (table.bucketMode() != BucketMode.FIXED) {
throw new UnsupportedOperationException(
"Unified Sink only supports FIXED bucket mode, but is " + table.bucketMode());
String.format(
"Combine mode Sink only supports FIXED bucket mode, but %s is %s",
table.name(), table.bucketMode()));
}
return table;
}
Expand Down