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

Harden string functions when NULL is passed #5

Merged
merged 2 commits into from Jun 7, 2023

Conversation

colincadams
Copy link
Collaborator

Description of the change

Many of the existing string function implementations fail when they receive NULL with an expected STRING or BYTES error. This adds a bunch of tests with what happens when NULL is passed to each param of these string functions in BQ (returns NULL or empty array) and updates the implementation to match.

Type of change

All pull requests must have at least one of the following labels applied (otherwise the PR will fail):

Label Description
Type: Bug non-breaking change that fixes an issue
Type: Feature non-breaking change that adds functionality
Type: Breaking Change fix or feature that would cause existing functionality to not work as expected
Type: Non-breaking refactor change addresses some tech debt item or prepares for a later change, but does not change functionality
Type: Configuration Change adjusts configuration to achieve some end related to functionality, development, performance, or security
Type: Dependency Upgrade upgrades a project dependency - these changes are not included in release notes

Related issues

Root cause of #20740, and many of the todos tagging #20752 which I incorrectly labeled.

Checklists

Development

This box MUST be checked by the submitter prior to merging:

  • Double- and triple-checked that there is no Personally Identifiable Information (PII) being mistakenly added in this pull request

These boxes should be checked by the submitter prior to merging:

  • Tests have been written to cover the code changed/added as part of this pull request

Code review

These boxes should be checked by reviewers prior to merging:

  • This pull request has a descriptive title and information useful to a reviewer
  • Potential security implications or infrastructural changes have been considered, if relevant

Copy link

@ageiduschek ageiduschek left a comment

Choose a reason for hiding this comment

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

Nice

@colincadams colincadams merged commit b2934d9 into main Jun 7, 2023
3 checks passed
@colincadams colincadams deleted the colincadams/r/string-func-null branch June 7, 2023 00:53
ohaibbq pushed a commit that referenced this pull request Jan 16, 2024
Harden string functions when NULL is passed
ohaibbq pushed a commit that referenced this pull request Feb 1, 2024
Harden string functions when NULL is passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants