feat(snowflake): use maximum VARCHAR length (128 MB) for string columns#4401
Open
JGustavo0 wants to merge 1 commit into
Open
feat(snowflake): use maximum VARCHAR length (128 MB) for string columns#4401JGustavo0 wants to merge 1 commit into
JGustavo0 wants to merge 1 commit into
Conversation
JGustavo0
had a problem deploying
to
external-contributor
June 9, 2026 11:39 — with
GitHub Actions
Failure
JGustavo0
had a problem deploying
to
external-contributor
June 9, 2026 11:39 — with
GitHub Actions
Failure
JGustavo0
had a problem deploying
to
external-contributor
June 9, 2026 11:39 — with
GitHub Actions
Failure
JGustavo0
had a problem deploying
to
external-contributor
June 9, 2026 11:39 — with
GitHub Actions
Failure
JGustavo0
had a problem deploying
to
external-contributor
June 9, 2026 11:39 — with
GitHub Actions
Failure
Amogh-Bharadwaj
approved these changes
Jun 9, 2026
Author
|
Anyone could help unlock this? |
Contributor
|
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.
Snowflake's bare
STRING/VARCHARdeclaration defaults to 16 MB even on accounts where the larger-size behavior change bundles are enabled. This silently caps PeerDB-managed string columns (Postgrestext/varchar/bpchar) at 16 MB instead of Snowflake's documented maximum of 128 MB (VARCHAR(134217728)).This PR adds a shared
SnowflakeMaxVarcharconstant and uses it for the generic string kind (QValueKindString) and the unknown-kind fallback. The change propagates automatically throughqvalue.ToDWHColumnTypeto:generateCreateTableSQLForNormalizedTable—CREATE TABLEReplayTableSchemaDeltas—ALTER TABLE ADD COLUMNgenerateMergeStmt—CAST(... AS <type>)inMERGEQValueKindEnum(tiny labels) andQValueKindUUID(36 chars) intentionally stay as bareSTRING— they can't exceed 16 MB anyway, so widening them would be noise.Security & performance
Storage: None. Snowflake bills based on actual data stored; declared length has no storage impact.
Performance: None. Per the Snowflake docs on string data types:
The same guarantee extends to
VARCHAR(134217728)— declared length is purely a logical ceiling and does not affect compression, micro-partition layout, or query performance.Security: Purely a column-width ceiling. Snowflake still enforces the 128 MB hard cap.
Compatibility
The 128 MB ceiling shipped via Snowflake behavior change bundles BCR-1779 (2024_08) and BCR-1942 (2025_03). On accounts where those bundles are disabled,
VARCHAR(134217728)DDL will be rejected. Both bundles are enabled by default on current accounts, so this is safe in practice.Test plan
flow/shared/types/...unit tests pass (used my account).TestSnowflakeSchemaDeltaTestSuite) runs against a real Snowflake account and passes. Logs confirm string columns are now emitted asVARCHAR(134217728)via theALTER TABLE ADD COLUMNpath.BOOLEAN,VARIANT,DATE,TIMESTAMP_*,NUMERIC,FLOAT,BINARY,TIME) emit unchanged.CREATE TABLE ... VARCHAR(134217728)smoke test).