apache / apache/paimon

[Bug] The first_value's result is not correct

Open
#3,020 0 comments 0 reactions 1 assignee Claimed by @Aitozi View on GitHub
bug
Dominant language
Java
Stars
3.4k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
396

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/incubator-paimon/issues) and found nothing similar.

### Paimon version

0.7

### Compute Engine

Flink

### Minimal reproduce step

```
CREATE TABLE T (
k INT,
a INT,
b VARCHAR,
c VARCHAR,
d VARCHAR,
PRIMARY KEY (k) NOT ENFORCED)
WITH ('merge-engine'='aggregation',
'changelog-producer' = 'full-compaction',
'fields.b.aggregate-function'='first_value',
'fields.c.aggregate-function'='first_non_null_value',
'fields.d.aggregate-function'='first_not_null_value',
'sequence.field'='a'
);
```

```java
@Test
public void testUnOrderInput2() {
batchSql("INSERT INTO T VALUES (1, 4, '4', '4', '4')");
batchSql("INSERT INTO T VALUES (1, 2, '2', '2', '2')");
batchSql("INSERT INTO T VALUES (1, 3, '3', '3', '3')");
List result = batchSql("SELECT * FROM T");
assertThat(result).containsExactlyInAnyOrder(Row.of(1, 2, "2", "2", "2"));
}
```

The acutal result is `+I[1, 4, 3, 3, 3]`

### What doesn't meet your expectations?

.

### Anything else?

_No response_

### Are you willing to submit a PR?

- [X] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.