Repository navigation
Conversation
Fixes client throwing errors like `Multiple entries with same key: number=1 and number=0` For queries with duplicate column names. IE: `select number, * from system.numbers limit 1;`
| colIndexMapBuilder.put(columnName, i); | ||
| } | ||
| this.colIndex = colIndexMapBuilder.build(); | ||
| this.colIndex = colIndexMapBuilder; |
Contributor
There was a problem hiding this comment.
The colIndex map is no longer immutable after switching from ImmutableMap to HashMap, but it's still exposed as a public field. Consider making this field private or ensuring it remains immutable by wrapping it with Collections.unmodifiableMap() to prevent external modifications.
chernser
reviewed
Oct 25, 2025
| this.query = query; | ||
| this.columns = ImmutableList.copyOf(columns); | ||
| ImmutableMap.Builder<String, Integer> colIndexMapBuilder = ImmutableMap.builder(); | ||
| Map<String, Integer> colIndexMapBuilder = new HashMap<>(); |
Contributor
There was a problem hiding this comment.
HashMap is much slower that ImmutableMap - that we have measured in our benchmark tests.
ImmutableMap allows to leave last value.
Contributor
|
Good day, @maxjustus ! Thank you for the contribution! However we have fix for the problem in review #2618 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes client throwing errors like
Multiple entries with same key: number=1 and number=0For queries with duplicate column names. IE:select number, * from system.numbers limit 1;. Aligns withclickhouse clientwhich allows duplicate column names.