apache / apache/kyuubi

[Bug] Mismatch between executionId in SparkListenerSQLExecutionStart and OperationLineageSparkEvent causes difficulty linking lineage with SQL executions

Open
#7,170 3 comments 0 reactions 0 assignees View on GitHub
kind:bug priority:major
Dominant language
Scala
Stars
2.4k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

### Search before asking

- [x] I have searched in the [issues](https://github.com/apache/kyuubi/issues?q=is%3Aissue) and found no similar issues.

### Describe the bug

When using SparkListener to receive lineage information from the Spark event bus, I observed that the executionId in OperationLineageSparkEvent does not match the executionId from SparkListenerSQLExecutionStart. The latter matches the execution ID shown in the Spark Web UI.

This discrepancy causes difficulty in associating lineage information with the corresponding SQL executions when outputting lineage data to files.

@Override
public void onOtherEvent(SparkListenerEvent event) {
if (event instanceof SparkListenerSQLExecutionStart) {
SparkListenerSQLExecutionStart e = (SparkListenerSQLExecutionStart) event;
System.out.println("** executionId :" + e.executionId());
// ...
} else if (event instanceof SparkListenerSQLExecutionEnd) {
SparkListenerSQLExecutionEnd e = (SparkListenerSQLExecutionEnd) event;
// output metrics info to file
} else if (event instanceof OperationLineageSparkEvent) {
OperationLineageSparkEvent e = (OperationLineageSparkEvent) event;
System.out.println("** executionId :" + e.executionId());
}
// ...
}

Is this a known issue? Or is there an alternative way to reliably link lineage events with SQL executions?

### Affects Version(s)

1.9

### Kyuubi Server Log Output

```logtalk

```

### Kyuubi Engine Log Output

```logtalk

```

### Kyuubi Server Configurations

```yaml

```

### Kyuubi Engine Configurations

```yaml

```

### Additional context

_No response_

### Are you willing to submit PR?

- [ ] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to fix.
- [ ] No. I cannot submit a PR at this time.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how SparkListenerSQLExecutionStart and OperationLineageSparkEvent are produced and how each assigns executionId, then compare them with the SQL execution ID shown in the Spark Web UI. Reproduce the event sequence with a lineage-producing query and confirm that the resulting lineage and SQL execution can be reliably associated.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala, spark, sql
Domain
data-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.