Skip to content

Fix height FULL OUTER JOIN coalescing h1 instead of h2#2013

Open
Chessing234 wants to merge 1 commit into
MIT-LCP:mainfrom
Chessing234:fix/2010-height-coalesce-h2
Open

Fix height FULL OUTER JOIN coalescing h1 instead of h2#2013
Chessing234 wants to merge 1 commit into
MIT-LCP:mainfrom
Chessing234:fix/2010-height-coalesce-h2

Conversation

@Chessing234

Copy link
Copy Markdown

Summary

In ht_stg0, COALESCE(h1.subject_id, h1.subject_id) (and stay_id/charttime) used h1 for both arguments after the FULL OUTER JOIN of cm and inch heights. Inch-only rows from ht_in had NULL keys and were dropped downstream.

Fix

Use h2 as the fallback for subject_id, stay_id, and charttime in all three dialect copies of height.sql.

Fixes #2010

Made with Cursor

Inch-only height rows from ht_in had NULL subject_id/stay_id/charttime
because COALESCE used h1 for both arguments.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

error in OUTER JOIN condition for mimic_derived.height

1 participant