Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,12 @@ private FlinkOptions() {
.noDefaultValue()
.withDescription("Parallelism of tasks that do bucket assign, default is the parallelism of the execution environment");

public static final ConfigOption<Integer> HOODIE_ROECORD_MAP_TASKS = ConfigOptions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo ROECORD -> RECORD

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wangxianghu
thanks for review, i had fixed the problem what you pointed out
pls review again

.key("hoodie.record_map.tasks")
.intType()
.noDefaultValue()
.withDescription("Parallelism of tasks that convert row data to hoodie record, default is the parallelism of the execution environment");

public static final ConfigOption<Integer> WRITE_TASKS = ConfigOptions
.key("write.tasks")
.intType()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public static DataStream<HoodieRecord> bootstrap(
boolean overwrite) {
final boolean globalIndex = conf.getBoolean(FlinkOptions.INDEX_GLOBAL_ENABLED);
if (overwrite || OptionsResolver.isBucketIndexType(conf)) {
return rowDataToHoodieRecord(conf, rowType, dataStream);
return rowDataToHoodieRecord(conf, rowType, dataStream, defaultParallelism);
} else if (bounded && !globalIndex && OptionsResolver.isPartitionedTable(conf)) {
return boundedBootstrap(conf, rowType, defaultParallelism, dataStream);
} else {
Expand All @@ -203,7 +203,7 @@ private static DataStream<HoodieRecord> streamBootstrap(
int defaultParallelism,
DataStream<RowData> dataStream,
boolean bounded) {
DataStream<HoodieRecord> dataStream1 = rowDataToHoodieRecord(conf, rowType, dataStream);
DataStream<HoodieRecord> dataStream1 = rowDataToHoodieRecord(conf, rowType, dataStream, defaultParallelism);

if (conf.getBoolean(FlinkOptions.INDEX_BOOTSTRAP_ENABLED) || bounded) {
dataStream1 = dataStream1
Expand Down Expand Up @@ -233,7 +233,7 @@ private static DataStream<HoodieRecord> boundedBootstrap(
dataStream = dataStream
.keyBy(rowDataKeyGen::getPartitionPath);

return rowDataToHoodieRecord(conf, rowType, dataStream)
return rowDataToHoodieRecord(conf, rowType, dataStream, defaultParallelism)
.transform(
"batch_index_bootstrap",
TypeInformation.of(HoodieRecord.class),
Expand All @@ -245,8 +245,9 @@ private static DataStream<HoodieRecord> boundedBootstrap(
/**
* Transforms the row data to hoodie records.
*/
public static DataStream<HoodieRecord> rowDataToHoodieRecord(Configuration conf, RowType rowType, DataStream<RowData> dataStream) {
return dataStream.map(RowDataToHoodieFunctions.create(rowType, conf), TypeInformation.of(HoodieRecord.class));
public static DataStream<HoodieRecord> rowDataToHoodieRecord(Configuration conf, RowType rowType, DataStream<RowData> dataStream, int defaultParallelism) {
return dataStream.map(RowDataToHoodieFunctions.create(rowType, conf), TypeInformation.of(HoodieRecord.class))
.setParallelism(conf.getOptional(FlinkOptions.HOODIE_ROECORD_MAP_TASKS).orElse(defaultParallelism));
}

/**
Expand Down