-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix issue with now() returning same value across statements #3210
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
fix issue with now() returning same value across statements #3210
Conversation
…ent statements. fix the issue so the tests pass.
Codecov Report
@@ Coverage Diff @@
## master #3210 +/- ##
==========================================
- Coverage 85.85% 85.85% -0.01%
==========================================
Files 291 291
Lines 52899 52938 +39
==========================================
+ Hits 45416 45448 +32
- Misses 7483 7490 +7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
andygrove
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.
LGTM. Thanks @kmitchener.
Bonus points if you could put a brief description in the user guide for now() while you are here, in the SQL scalar function reference.
|
Good thinking, docs updated. |
|
Actually, I'm going to make this a WIP because I tested with a now() in a view and that code path is still broken. Needs a more robust fix. Will pick it up again in a couple days. |
You can convert this pr as a draft @kmitchener If there are some bug or issue not resolved |
… during the create_physical_plan() call so this test is misleading and duplicative
…ssion add test for now() expression via dataframe API
don't store optimized logical plan in View. store the original unmodified plan and optimize on every execution of the view. added tests to cover all cases
|
@andygrove PTAL |
andygrove
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.
LGTM, but I think one test needs to be added. See earlier comment.
|
Benchmark runs are scheduled for baseline = c72f547 and contender = eedc787. eedc787 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
alamb
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.
Thank you for thisPR @kmitchener 👍
Which issue does this PR close?
Closes #3057 .
Rationale for this change
What changes are included in this PR?
Root cause of the issue was that down one code path, creating a physical plan wasn't setting the query_execution_start_time in session state. I've fixed it by making the code the same between DataFrame's create_physical_plan() and SessionContext's create_physical_plan().
I'm still not that happy with how I solved it the root issue with the SessionState cloning via this code duplication, but can follow up with a separate PR.
Are there any user-facing changes?
now() works correctly across statements in the same session regardless of code path taken to execute the SQL