ggjh-159 commented on code in PR #12304:
URL: https://github.com/apache/gluten/pull/12304#discussion_r3434659669
##########
gluten-flink/planner/src/main/java/org/apache/gluten/velox/NexmarkSourceFactory.java:
##########
@@ -72,26 +82,32 @@ public Transformation<RowData> buildVeloxSource(
"getSplits",
new Class<?>[] {int.class},
new Object[] {transformation.getParallelism()});
- Object nexmarkSourceSplit = nexmarkSourceSplits.get(0);
- Object generatorConfig =
- ReflectUtils.getObjectField(
- nexmarkSourceSplit.getClass(), nexmarkSourceSplit,
"generatorConfig");
- Long maxEvents =
- (Long)
- ReflectUtils.getObjectField(generatorConfig.getClass(),
generatorConfig, "maxEvents");
+
+ // Convert each subtask's GeneratorConfig to velox4j
+ List<NexmarkConnectorSplit> subtaskSplits = new ArrayList<>();
+ for (Object nexmarkSourceSplit : nexmarkSourceSplits) {
+ Object generatorConfig =
+ ReflectUtils.getObjectField(
+ nexmarkSourceSplit.getClass(), nexmarkSourceSplit,
"generatorConfig");
+ subtaskSplits.add(
+ new NexmarkConnectorSplit(
+ "connector-nexmark", toVeloxGeneratorConfig(generatorConfig),
null));
Review Comment:
Addressed. Split into two types:
- `NexmarkConnectorSplit` — leaf split, `extends ConnectorSplit`, only
carries
`NexmarkGeneratorConfig config`. Serialized across the Java/C++ boundary
as before.
- `NexmarkParallelSplit` — container, `extends ParallelSplit`, holds
`List<NexmarkConnectorSplit> subtaskSplits`. Only this type implements
`getSubtaskSplit`, so a leaf split can no longer be mistaken for a parallel
container.
`NexmarkSourceFactory` now builds a `NexmarkParallelSplit` wrapping the
per-subtask leaf splits, and the `instanceof ParallelSplit` check in
`GlutenSourceFunction` cleanly distinguishes container vs leaf.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]