apache / paimon

Apache Paimon is a lake format that enables building a Realtime Lakehouse Architecture with Flink and Spark for both streaming and batch operations.
https://paimon.apache.org/
Apache License 2.0
2.43k stars 957 forks source link

[core] Support sequence.field sort order for pk table #4385

Closed xuzifu666 closed 3 weeks ago

xuzifu666 commented 3 weeks ago

Purpose

In production such as compute ealist login time zipper table,user want to get the small record to query when set sequence.field, currently paimon can only get the largest record, user need (Long.max - timestamp) which is not very convenient. This pr is aimed to support user set sequence.field order to get largest or small record with a option sequence.field.sort.is.ascending, default true keep the largest one,with false keep the small one. eg like ut case.

Linked issue: close #xxx

Tests

API and Format

Documentation

xuzifu666 commented 3 weeks ago

Addressed, PTAL @JingsongLi