Skip to content

[core] Fix record comparator cache key for sort order#7222

Open
Liulietong wants to merge 1 commit intoapache:masterfrom
Liulietong:fix-codegenutils-comparator-cache
Open

[core] Fix record comparator cache key for sort order#7222
Liulietong wants to merge 1 commit intoapache:masterfrom
Liulietong:fix-codegenutils-comparator-cache

Conversation

@Liulietong
Copy link

@Liulietong Liulietong commented Feb 5, 2026

Problem

The cache key for recordComparator only considered the sort key types but ignored the sort order (ascending/descending). This caused comparators with different sort orders to share the same cached class, leading to incorrect sorting behavior.

Solution

Include SortOrder in the cache key generation to ensure each unique sort order combination gets its own generated comparator class.

Summary

  • Include sort order in the codegen cache key for record comparators
  • Add a regression test for ascending/descending comparator cache collisions

Testing

mvn -pl paimon-core -Dtest=CodeGenUtilsTest test

@Liulietong Liulietong force-pushed the fix-codegenutils-comparator-cache branch from ba7104f to 23f70b2 Compare February 6, 2026 13:54
@Liulietong
Copy link
Author

Hi @JingsongLi, could you help review this PR? It's a fix for the record comparator cache key to include sort order. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant