expression: return null for empty time format#67538
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTIME_FORMAT now returns NULL when given an empty format string. Both scalar and vectorized evaluation paths were changed to treat "" as NULL, and unit tests (scalar and vectorized) were added to assert this behavior (issue Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.11.4)Command failed Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #67538 +/- ##
================================================
+ Coverage 77.5948% 78.4488% +0.8539%
================================================
Files 1981 1974 -7
Lines 547950 550676 +2726
================================================
+ Hits 425181 431999 +6818
+ Misses 121959 118240 -3719
+ Partials 810 437 -373
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest |
f286831 to
f976add
Compare
|
/retest |
| } | ||
| if len(formatMask) == 0 { | ||
| return "", true, nil | ||
| } |
There was a problem hiding this comment.
what about the vec version?
There was a problem hiding this comment.
Good catch. I fixed the vectorized path as well and added a dedicated vectorized regression test in 187e8d8.
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: guo-shaoge, windtalker The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/retest |
7 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
10 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
What problem does this PR solve?
Issue Number: close #59445
Problem Summary:
TIME_FORMAT(expr, format)should returnNULLwhenformatis an empty string.What changed and how does it work?
NULLearly inbuiltinTimeFormatSig.evalStringwhen the format string is empty.TestTimeFormatforTIME_FORMAT('12:34:56', '').Check List
Tests
Validation:
bazel test //pkg/expression:expression_test --test_sharding_strategy=disabled --test_arg=-test.run=^TestTimeFormat$ --test_arg=-test.v --test_output=streamedmake lintSide effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit
Bug Fixes
Tests