fix: don't annotate non-native type values with ::TYPE inside STRUCT while Inlining#1157
Open
neel-leendev wants to merge 2 commits into
Open
fix: don't annotate non-native type values with ::TYPE inside STRUCT while Inlining#1157neel-leendev wants to merge 2 commits into
neel-leendev wants to merge 2 commits into
Conversation
…inlining
When a STRUCT column is inlined on Postgres/SQLite, field values of non-natively
supported types (TIMESTAMPTZ, DATE, etc.) were serialized as CAST('value' AS VARCHAR).
This annotation survives verbatim in the stored struct string and breaks the
struct-from-string parser on read-back, causing an internal crash in
TransformInlinedData.
Fix: emit a plain quoted string when !use_native_type since the storage column
is already VARCHAR — the annotation is redundant and harmful in this context.
pdet
reviewed
May 15, 2026
Member
pdet
left a comment
There was a problem hiding this comment.
Hi @neel-leendev, thanks for the PR, is looking good, just had a few comments!
| @@ -0,0 +1,39 @@ | |||
| # name: test/sql/data_inlining/data_inlining_struct_non_native_types.test | |||
| # description: STRUCT columns with non-natively-supported field types (e.g. TIMESTAMPTZ on Postgres) | |||
Member
There was a problem hiding this comment.
Can we parameterize the test to the other affected types?
i.e.,
case LogicalTypeId::UUID:
case LogicalTypeId::DATE:
case LogicalTypeId::TIME:
case LogicalTypeId::TIME_NS:
case LogicalTypeId::TIMESTAMP:
case LogicalTypeId::TIME_TZ:
case LogicalTypeId::TIMESTAMP_TZ:
case LogicalTypeId::TIMESTAMP_SEC:
case LogicalTypeId::TIMESTAMP_MS:
case LogicalTypeId::TIMESTAMP_NS:
case LogicalTypeId::BLOB:
case LogicalTypeId::GEOMETRY:
| case LogicalTypeId::INTERVAL: { | ||
| auto interval = IntervalValue::Get(value); | ||
| if (!use_native_type) { | ||
| return EscapeVarcharForSQL(value.ToString()); |
Member
There was a problem hiding this comment.
Is the format of value.ToString() the same as '%d months %d days %lld microseconds'?
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.
When a STRUCT column is inlined on Postgres/SQLite, field values of non-natively supported types (TIMESTAMPTZ, DATE, etc.) were serialized as CAST('value' AS VARCHAR). This annotation survives verbatim in the stored struct string and breaks the struct-from-string parser on read-back, causing an internal crash in TransformInlinedData.
Fix: emit a plain quoted string when !use_native_type since the storage column is already VARCHAR — the annotation is redundant and harmful in this context.
Related to #1155