Skip to content

fix(IterableSQLDataSource): use column index instead of name in getNextFrom#181

Merged
adamw7 merged 1 commit into
mainfrom
fix/iterable-sql-datasource-column-index
Jun 2, 2026
Merged

fix(IterableSQLDataSource): use column index instead of name in getNextFrom#181
adamw7 merged 1 commit into
mainfrom
fix/iterable-sql-datasource-column-index

Conversation

@adamw7
Copy link
Copy Markdown
Owner

@adamw7 adamw7 commented Jun 2, 2026

Summary

  • getNextFrom was calling resultSet.getString(columnName), which returns the first matching column when a query produces duplicate column names (e.g. SELECT * FROM a JOIN b ON a.id = b.id yields two id columns). This silently produces wrong row data for the second and subsequent duplicate-named columns.
  • Fixed by switching to resultSet.getString(i + 1) (1-based positional index), which always retrieves the correct column regardless of name duplication.
  • Extended happyPathMultiTable test to assert all 5 columns from the SALARY INNER JOIN PEOPLE result, including both duplicate ID columns at positions 0 and 2.

Fixes issue #9 from issues.md.

Test plan

  • SQLDataSourceTest#happyPathMultiTable now verifies all 5 join columns, including both ID values
  • All existing SQLDataSourceTest cases (6 total) pass with mvn test -pl data -Dtest=SQLDataSourceTest

🤖 Generated with Claude Code

…xtFrom

getString(name) returns the first matching column for duplicate names
in joins, silently producing wrong row data. Switch to getString(i+1)
to retrieve each column by its 1-based index.

Extend happyPathMultiTable test to assert all 5 columns from the
SALARY INNER JOIN PEOPLE result, including both duplicate ID columns.

Fixes #9

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@adamw7 adamw7 merged commit 5abee9e into main Jun 2, 2026
3 checks passed
@adamw7 adamw7 deleted the fix/iterable-sql-datasource-column-index branch June 2, 2026 14:27
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