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

evalengine: more comprehensive type coverage #9804

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

vmg
Copy link
Collaborator

@vmg vmg commented Mar 1, 2022

Description

Since we've started using the evaluation engine for VDiff, @mattlord has found several issues where our type coverage was not good enough and we were failing to operate on types that were (in theory) supported but that we failed to handle because our type checks where too constricted (e.g. TEXT vs CHAR vs VARCHAR).

This PR attempts to fix any further cases that may come up in the future by switching the evalengine to using the sqltypes.IsXXX category checks instead of explicitly comparing against specific types. It also cleans up some technical debt by renaming some helper methods which were IMO a bit confusing.

Related Issue(s)

Checklist

  • Should this PR be backported?
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

Signed-off-by: Vicent Marti <vmg@strn.cat>
Copy link
Contributor

@mattlord mattlord left a comment

Choose a reason for hiding this comment

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

Thank you! ❤️

@@ -339,16 +371,16 @@ func (er *EvalResult) makeTextualAndConvert(collation collations.ID) bool {
}

func (er *EvalResult) truncate(size int) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit but IMO the function should be called ~ enforceSize since we truncate or pad as needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 will refactor

@vmg vmg merged commit 605beab into vitessio:main Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Evalengine changes to the evaluation engine Type: Internal Cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants