-
-
Notifications
You must be signed in to change notification settings - Fork 238
Unwrap inputs to REGEXP_LIKE, REPLACE, and RPAD/LPAD functions. #2964
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
Conversation
macneale4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'm not sure why those blocks are there, but you can ship it if you want them there for some reason I'm not seeing.
|
|
||
| if fromStr.(string) == "" { | ||
| return str, nil | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the additional block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The blocks are there so that I can redeclare fromStr et al as strings instead of interface{}. Without the block I'd need to pick new names for the unwrapped versions, which would be noisy.
| } | ||
|
|
||
| return padString(str.(string), length.(int64), padStr.(string), p.padType) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again on the block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
These are a couple more functions whose inputs aren't being unwrapped. If the inputs come from a column with a
TEXTtype, then they won't be converted to strings and the functions will fail. This PR fixes this by making sure that the inputs are converted.We missed this previously because although we have tests for these functions, none of them tested getting the inputs from TEXT columns of a table.