Feat: Introduce runtime check for identifier limits per engine#4432
Merged
Feat: Introduce runtime check for identifier limits per engine#4432
Conversation
dfcb354 to
b1e3086
Compare
izeigerman
approved these changes
May 19, 2025
georgesittas
approved these changes
May 20, 2025
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.
Fixes #4082
This PR introduces an identifier limit check right before SQL execution in the engine adapter and enables this check for Postgres & MySQL; These 2 dialects are the only ones with <100 char limits afaict, but we can always go ahead and fill in the rest of the engines too.
In my opinion, the main consideration of this PR is to not cause this issue on our end which should mostly happen during physical table creation; This is the reason that we'll walk the AST only if (1) the engine adapter has set its limit and (2) if the expression is a DDL.
We can also enable this check for any query expression but we'll introduce a perf hit; This might help unsuspecting users catch some nasty bugs in their SQL, but I wasn't sure if it's worth the added regression on every expression-based
executecall.The reason
MAX_IDENTIFIER_LENGTHis generally set toNoneis because other dialects either don't make it clear what their limits are (e.g DuckDB) or allow for much larger table names (e.g BigQuery with 1024 chars).Docs
Postgres | MySQL