You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "thswlsqls (via GitHub)" <gi...@apache.org> on 2026/07/21 03:31:54 UTC
[I] [Bug] Generated map comparator compares values using the key type [paimon]
thswlsqls opened a new issue, #8762:
URL: https://github.com/apache/paimon/issues/8762
**Search before asking**
- [x] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.
**Paimon version**
master @ 345526e26 / 2.0-SNAPSHOT
**Compute Engine**
Engine-agnostic (core / paimon-codegen)
**Minimal reproduce step**
`GenerateUtils.generateMapCompare()` (`paimon-codegen/.../codegen/GenerateUtils.scala` line 251) builds the value array type from `mapType.getKeyType` instead of `mapType.getValueType`, so a generated `MAP` comparator reads the value array with the key type. Reproduce with `CodeGenUtils.newRecordComparator(Arrays.asList(MAP(INT(), STRING())), new int[]{0})` comparing two maps with equal keys but different values (`{1 -> "a"}` vs `{1 -> "b"}`).
**What doesn't meet your expectations?**
Expected: values compared by the value type (STRING), so `{1->"a"} < {1->"b"}`. Actual: values read with the key type (INT) → wrong comparison result, or a `ClassCastException` when key and value types differ.
**Anything else?**
The sibling `generateMultisetCompare` (line 262-263) and `ScalarOperatorGens` (line 81) both pass key and value types separately, confirming the intended behavior. Introduced in the original MAP/MULTISET comparison support.
**Are you willing to submit a PR?**
- [x] I'm willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Generated map comparator compares values using the key type [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi closed issue #8762: [Bug] Generated map comparator compares values using the key type
URL: https://github.com/apache/paimon/issues/8762
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org