apache / apache/kyuubi

[TASK][CHALLENGE] JDBC driver supports affected rows

Open
#6,269 3 comments 0 reactions 1 assignee Claimed by @slfan1989 View on GitHub
Dominant language
Scala
Stars
2.4k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

### What's the level of this task?

CHALLENGE

### Code of Conduct

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

### Search before creating

- [X] I have searched in the [task list](https://github.com/orgs/apache/projects/343) and found no similar tasks.

### Mentor

- [X] I have sufficient expertise on this task, and I volunteer to be a mentor of this task to guide contributors through the task.

### Skill requirements

- Knowledge of Java, Thrift, JDBC

### Background and Goals

JDBC standard requires the following method return affected rows.
```
java.sql.Statement#executeUpdate(java.lang.String) => int
```

Hive added such a feature in 4.0.0 https://issues.apache.org/jira/browse/HIVE-14388

### Implementation steps

This is an umbrella ticket to track all sub-tasks

- https://github.com/apache/kyuubi/issues/6252 covers thrift protocol upgrading, which adds an optional field `numModifiedRows` in `TGetOperationStatusResp`
- Modify the JDBC driver to support affected rows, refer to https://github.com/apache/hive/issues/4819
- As Kyuubi supports multi-computing engines, some engines like Spark themselves do not report affected rows but some engines like JDBC do. We can start with the JDBC engine to let them report affected rows after completing the DML operations, and propagate to client side
- Making changes in computing engines to allow them to report affected rows (this is the most challenging part of this task)

### Additional context

Introduction of [2024H1 Kyuubi Code Contribution Program](https://github.com/apache/kyuubi/issues/6232)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.