Skip to content

test(csvim): quote identifiers so CSVIM ITs pass on PostgreSQL - #6701

Merged
delchev merged 1 commit into
eclipse-dirigible:masterfrom
NicoleNG18:fix/csvim-it-postgres-identifier-quoting
Aug 13, 2026
Merged

test(csvim): quote identifiers so CSVIM ITs pass on PostgreSQL#6701
delchev merged 1 commit into
eclipse-dirigible:masterfrom
NicoleNG18:fix/csvim-it-postgres-identifier-quoting

Conversation

@NicoleNG18

Copy link
Copy Markdown
Contributor

Problem

master is red on the integration-tests-postgresql leg: 5 failures in CsvProcessorIT and CsvimReimportIT, e.g.

Table metadata was not found for table [CSV_A] in schema [null]
CsvProcessorIT.importNonStrictMode:136  expected: <2> but was: <0>

These two ITs were compiled but never actually executed until #6684 wired them into the suite, which exposed a pre-existing H2-only assumption on the PostgreSQL leg.

Root cause

Both tests create their fixture tables with unquoted DDL (CREATE TABLE CSV_A ...) and then look them up by the literal uppercase name with a null schema. Unquoted identifiers fold to UPPERCASE on H2 but to lowercase on PostgreSQL, and DatabaseNameNormalizer.normalizeTableName only strips quotes — it does not fold case. So on PostgreSQL the metadata lookup in CsvimProcessor.process (via CsvimUtils.getTableMetadataDatabaseMetadataHelper.describeTable) misses the lowercase-stored table and throws. The expected: <2> but was: <0> variants are the non-strict form of the same miss (0 rows imported).

Fix

Quote the table and column identifiers in the DDL/DML so both databases store them in the same case, matching the uppercase name passed to CsvFile and the uppercase CSV headers. This mirrors how the real .table synchronizer path stores identifiers and the convention already used by every other JDBC-style IT in the suite (DatabaseCrudNullValuesIT, SchemaRepublishTypeToleranceIT, NumberingSdkIT, and the passing sibling test in CsvimReimportIT itself).

Test-only change; no production code touched.

Verification

Analysis-verified. I could not run the PostgreSQL leg locally (no Docker), so it has not yet been run-verified against PostgreSQL 16.

Note: the integration-tests-h2 leg on the same failing run hit the 2h30m max-execution-time cap (a hang), which is a separate issue this PR does not address.

🤖 Generated with Claude Code

CsvProcessorIT and CsvimReimportIT create their fixture tables with
unquoted DDL (CREATE TABLE CSV_A ...) and then look them up by the
literal uppercase name with a null schema. Unquoted identifiers fold to
UPPERCASE on H2 but to lowercase on PostgreSQL, and
DatabaseNameNormalizer does not fold case, so the metadata lookup in
CsvimProcessor.process misses on the PostgreSQL CI leg and throws
"Table metadata was not found for table [CSV_A] in schema [null]"
(5 failures once eclipse-dirigible#6684 wired these previously-never-executed ITs in).

Quote the table and column identifiers in the DDL/DML so both databases
store them in the same case, matching the uppercase name passed to
CsvFile and the uppercase CSV headers. This mirrors how the real .table
synchronizer path stores identifiers and the convention already used by
every other JDBC-style IT (DatabaseCrudNullValuesIT,
SchemaRepublishTypeToleranceIT, NumberingSdkIT).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@delchev
delchev merged commit 3e713ad into eclipse-dirigible:master Aug 13, 2026
10 checks passed
@NicoleNG18
NicoleNG18 deleted the fix/csvim-it-postgres-identifier-quoting branch August 13, 2026 12:10
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.

2 participants