Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MSSQL] TOAST #1079

Merged
merged 3 commits into from
Dec 12, 2024
Merged

[MSSQL] TOAST #1079

merged 3 commits into from
Dec 12, 2024

Conversation

Tang8330
Copy link
Contributor

@Tang8330 Tang8330 commented Dec 12, 2024

Same rationale as #1078 and #1077.

Matching TOASTED placeholders using LIKE

@Tang8330 Tang8330 changed the title [WIP] MSSQL Toast [WIP] MSSQL TOAST Dec 12, 2024
@Tang8330 Tang8330 marked this pull request as ready for review December 12, 2024 23:00
@Tang8330 Tang8330 requested a review from a team as a code owner December 12, 2024 23:00
@Tang8330 Tang8330 changed the title [WIP] MSSQL TOAST [MSSQL] TOAST Dec 12, 2024
}

return fmt.Sprintf("COALESCE(%s, '') != '%s'", colName, constants.ToastUnavailableValuePlaceholder)
return fmt.Sprintf("COALESCE(%s, '') NOT LIKE '%s'", colName, toastedValue)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you just do

return fmt.Sprintf("COALESCE(%s, '') NOT LIKE '%%s%'", colName, constants.ToastUnavailableValuePlaceholder)

instead of defining toastedValue above, or do the extra %s mess with fmt.Sprintf?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I guess that's not really more readable though, so I'm also good with it as-is)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I did it like this because % is used to start string interpolation

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nice, that's what I suspected

@Tang8330 Tang8330 merged commit 6971259 into master Dec 12, 2024
3 checks passed
@Tang8330 Tang8330 deleted the mssql-toast branch December 12, 2024 23:07
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.

2 participants