-
Couldn't load subscription status.
- Fork 613
[JDBC-V2, Client-V2] fixes problem with duplicate column names #2618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…n the column index lookup by name map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 To request another review, post a new comment with "/windsurf-review".
| client.execute("DROP TABLE IF EXISTS test_duplicate_column_names_1").get().close(); | ||
| client.execute("DROP TABLE IF EXISTS test_duplicate_column_names_2").get().close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table names in the DROP statements don't match the CREATE statements. The DROP statements use test_duplicate_column_names_1 and test_duplicate_column_names_2 (with underscores), but the CREATE statements use test_duplicate_column_names1 and test_duplicate_column_names2 (without underscores).
| client.execute("DROP TABLE IF EXISTS test_duplicate_column_names_1").get().close(); | |
| client.execute("DROP TABLE IF EXISTS test_duplicate_column_names_2").get().close(); | |
| client.execute("DROP TABLE IF EXISTS test_duplicate_column_names1").get().close(); | |
| client.execute("DROP TABLE IF EXISTS test_duplicate_column_names2").get().close(); |
Also, consider adding similar DROP statements at the end of the test to clean up the created tables.
| colIndexMapBuilder.put(this.columns.get(i).getColumnName(), i); | ||
| } | ||
| this.colIndex = colIndexMapBuilder.build(); | ||
| this.colIndex = colIndexMapBuilder.buildKeepingLast(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change addresses the duplicate column names issue by keeping the last occurrence of a column name in the index map. Consider adding a comment explaining this behavior, as it's an important detail for users of this API to understand that when duplicate column names exist, only the last one will be accessible via name-based lookups.
|


Summary
Closes #2459
Closes #2336
Checklist
Delete items not relevant to your PR: