apache / apache/kyuubi

[FEATURE] Expose the query operator as Flink SQL client done for the select query.

Open
#6,880 0 comments 0 reactions 0 assignees View on GitHub
kind:feature 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 feature

## which feature we need
Expose the query operator as Flink SQL client done for the select query.

query like this
```
select sum(a) ,count(*) from sou
```

- before this feature(data return as duplicate, make user confuse)
+--------------+---------+------------+
| EXPR$0 | EXPR$1 |
+--------------+---------+------------+
| -1861035379 | 1 |
| -1861035379 | 1 |
| -317406356 | 2 |
| -317406356 | 2 |
| -684766290 | 3 |
| -684766290 | 3 |

- after (as flink sql client table SET 'sql-client.execution.result-mode' = 'changelog'; setting )
+--------------+---------+------------+
| EXPR$0 | EXPR$1 | op |
+--------------+---------+------------+
| -1861035379 | 1 | +I |
| -1861035379 | 1 | -U |
| -317406356 | 2 | +U |
| -317406356 | 2 | -U |
| -684766290 | 3 | +U |
| -684766290 | 3 | -U |

### Motivation

## why is nessary ?
The concept of changelog is specific to Flink SQL. If the operation is not exposed, users will be confused when using JDBC/Beeline.

### Describe the solution

1. FlinkOperation add operator column meta.
2. FlinkTRowSetGenerator add opeartor as rowdata return .

### Additional context

_No response_

### Are you willing to submit PR?

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

Contributor guide

Open the contributing guide

Research direction

Start by locating FlinkOperation and FlinkTRowSetGenerator, then trace how select-query results are exposed through JDBC/Beeline. Add the operator column metadata and return the operator with each row, matching Flink's changelog result mode. Done means changelog operations such as +I, -U, and +U are visible instead of duplicate-looking rows.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala, sql
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.