-
Notifications
You must be signed in to change notification settings - Fork 180
Specify timestamp field with timefield in timechart command
#4784
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
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
… visitor Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
timefield in timechart command
| Optional.ofNullable(argMap.get("timefield")) | ||
| .map(l -> (String) l.getValue()) | ||
| .orElse(OpenSearchConstants.IMPLICIT_FIELD_TIMESTAMP); | ||
| Field spanField = AstDSL.field(timeFieldName); |
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.
Could you check if we need to use this specified time field in transformPerFunction for per functions as well?
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.
Yes, I think we need to use the specified timefield in per functions because otherwise they'll refer to the non-existing @timestamp field. I added an integration test for this case.
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
dai-chen
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.
Thanks for the changes!
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
|
The backport to To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.19-dev 2.19-dev
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.19-dev
# Create a new branch
git switch --create backport/backport-4784-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 afc98dd6757288b8b269b78d8e2e5f323f78cae6
# Push it to GitHub
git push --set-upstream origin backport/backport-4784-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-devThen, create a pull request where the |
…arch-project#4784) * Support param timefield to specify span field in timechart Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Update doc to introduce timefield parameter Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Update ASTBuilderTest for chart: default args are handled in rel node visitor Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Fix ast expression builder test Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Fix anomanyzer test Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Support using specified timefield in per functions Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Omit by-timestamp clause in timechart command Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Mask timefield argument in anonymizer Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Anonymize argument span Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> --------- Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> (cherry picked from commit afc98dd) Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
…#4863) * Support param timefield to specify span field in timechart * Update doc to introduce timefield parameter * Update ASTBuilderTest for chart: default args are handled in rel node visitor * Fix ast expression builder test * Fix anomanyzer test * Support using specified timefield in per functions * Omit by-timestamp clause in timechart command * Mask timefield argument in anonymizer * Anonymize argument span --------- (cherry picked from commit afc98dd) Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
…arch-project#4784) * Support param timefield to specify span field in timechart Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Update doc to introduce timefield parameter Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Update ASTBuilderTest for chart: default args are handled in rel node visitor Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Fix ast expression builder test Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Fix anomanyzer test Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Support using specified timefield in per functions Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Omit by-timestamp clause in timechart command Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Mask timefield argument in anonymizer Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> * Anonymize argument span Signed-off-by: Yuanchun Shen <yuanchu@amazon.com> --------- Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
Description
Allow users to specify a timestamp field instead of assuming there exists a
@timestampfield when usingtimechartcommand.For example, the following query is made possible:
source=events | timechart timefield=start_at span=1hour by categoryRelated Issues
Resolves #4576
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.