Skip to content

[Bugfix] PostgreSQL case sensitivity bug in UNNEST alias for flat collections#242

Merged
suresh-prakash merged 1 commit intohypertrace:mainfrom
suddendust:unnest_mixed_case_col_fix
Oct 16, 2025
Merged

[Bugfix] PostgreSQL case sensitivity bug in UNNEST alias for flat collections#242
suresh-prakash merged 1 commit intohypertrace:mainfrom
suddendust:unnest_mixed_case_col_fix

Conversation

@suddendust
Copy link
Contributor

Description

When using UNNEST on flat collections with mixed-case field names (e.g., categoryTags), PostgreSQL threw an error: column "attributes_dot_authTypes_unnested" does not exist Hint: Perhaps you meant to reference the column "attributes_dot_authtypes_unnested".

Root Cause

The UNNEST alias was created without quotes, causing PostgreSQL to lowercase it (categorytags_unnested), but references used quotes preserving the original case ("categoryTags_unnested"), resulting in a mismatch.

Solution

Both aliases are now generated as: p1("categoryTags_unnested") instead of p1(categoryTags_unnested), eliminating the mismatch

Testing

  • Added integration test testFlatPostgresCollectionUnnestMixedCaseField with categoryTags field.
  • Test reproduces the bug without the fix and passes with the fix.
  • Existing lowercase field tests continue to pass (case insensitivity unaffected).

@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.88%. Comparing base (5c65ef6) to head (165bf93).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #242      +/-   ##
============================================
+ Coverage     79.87%   79.88%   +0.01%     
- Complexity     1099     1100       +1     
============================================
  Files           213      213              
  Lines          5396     5400       +4     
  Branches        473      473              
============================================
+ Hits           4310     4314       +4     
  Misses          760      760              
  Partials        326      326              
Flag Coverage Δ
integration 79.88% <100.00%> (+0.01%) ⬆️
unit 56.88% <60.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@suresh-prakash suresh-prakash merged commit e0ada8e into hypertrace:main Oct 16, 2025
6 checks passed
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