Add support for default value on a dimension link when there are nulls after a join#1714
Merged
shangyian merged 8 commits intoDataJunction:mainfrom Jan 27, 2026
Merged
Conversation
✅ Deploy Preview for thriving-cassata-78ae72 canceled.
|
8f31820 to
bff042f
Compare
7eac834 to
87cb6ef
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When using left or right joins for dimension links, unmatched rows produce
NULLvalues for dimension columns. This can be problematic for downstream consumers that expect non-null values.The PR adds support for setting
default_valueon a dimension link, which enables users to specify a fallback value (e.g., "Unknown", "N/A") that will be used in place of NULL. When a dimension link has adefault_valueconfigured, dimension columns will be wrapped inCOALESCE(column, 'default_value')in the generated SQL, providing a fallback value when the join doesn't match.The changes are needed across various interfaces:
Database + Models
default_valuecolumn to DimensionLink database modelYAML Support
SQL Generation
build_dimension_attributeto wrap dimension columns in coalescebuild_select_ast()to apply coalesceGenerates queries like
GraphQL
Added defaultValue field to DimensionLink type in the GraphQL schema
UI
Added "Default Value" form field to the complex dimension link popover.
Test Plan
make checkpassesmake testshows 100% unit test coverageDeployment Plan