Add time conversion functions for convert command#5210
Add time conversion functions for convert command#5210ritvibhatt wants to merge 22 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
PR Reviewer Guide 🔍(Review updated until commit 7394650)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 7394650 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 39e95ec
Suggestions up to commit 8d3b734
Suggestions up to commit 4364539
Suggestions up to commit afa3915
Suggestions up to commit 6f6162e
|
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
|
Persistent review updated to latest commit eae36db |
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
|
Persistent review updated to latest commit 73f4088 |
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 82fd69f.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Persistent review updated to latest commit 82fd69f |
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
|
Persistent review updated to latest commit b45ff6d |
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit becd73e.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Persistent review updated to latest commit becd73e |
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 93f7768.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Persistent review updated to latest commit 93f7768 |
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
|
Persistent review updated to latest commit 80b16a9 |
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
|
Persistent review updated to latest commit fdc0b67 |
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
|
Persistent review updated to latest commit da6cfeb |
|
Persistent review updated to latest commit 5ac49be |
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
|
Persistent review updated to latest commit 215b59b |
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
|
Persistent review updated to latest commit 4364539 |
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
|
Persistent review updated to latest commit 8d3b734 |
| +----------+ | ||
| | duration | | ||
| |----------| | ||
| | 5025.0 | |
There was a problem hiding this comment.
Yes, if there is a numeric value passed to the function like "5025.5", it should return 5025.5
|
|
||
| ## Example 11: Using timeformat with ctime() and mktime() | ||
|
|
||
| The `timeformat` parameter specifies a strftime format string for `ctime()` and `mktime()`: |
There was a problem hiding this comment.
np: mktime is not demonstrated below?
There was a problem hiding this comment.
Thanks for catching that! Updated to include an example with mktime
| +----------+ | ||
| | time_str | | ||
| |----------| | ||
| | 225.5 | |
There was a problem hiding this comment.
Yes fractional seconds are allowed so should return a double
| registerOperator(CTIME, PPLBuiltinOperators.CTIME); | ||
| registerOperator(MKTIME, PPLBuiltinOperators.MKTIME); | ||
| registerOperator(MSTIME, PPLBuiltinOperators.MSTIME); | ||
| registerOperator(DUR2SEC, PPLBuiltinOperators.DUR2SEC); |
There was a problem hiding this comment.
All these have to a UDF?
There was a problem hiding this comment.
Yeah, I couldn't find any Calcite operators that handled parsing time the formats that was needed for these functions
| calcite: | ||
| logical: | | ||
| LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT]) | ||
| LogicalProject(ts=[CTIME(1066507633)]) |
There was a problem hiding this comment.
Please double check if it's necessary to add 2 yaml files for new PPL function. Also this ymal is almost the same as no pushdown version, are these new function not pushed down anyway?
There was a problem hiding this comment.
The functions aren't pushed down, pushdown implementation will be in a follow up PR but I think the explain tests look for the files in both folders so both files are necessary.
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
|
Persistent review updated to latest commit 39e95ec |
Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
|
Persistent review updated to latest commit 7394650 |
Description
Implement ctime, mktime, mstime, and dur2sec conversion functions for the PPL convert command, along with timeformat parameter support.
Changes
Testing
Related Issues
Related to #5031
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.