-
Notifications
You must be signed in to change notification settings - Fork 348
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
feat: define basic structures and implement TimeFilter #5086
Conversation
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Copilot reviewed 6 out of 6 changed files in this pull request and generated no suggestions.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5086 +/- ##
==========================================
- Coverage 84.02% 83.78% -0.24%
==========================================
Files 1157 1159 +2
Lines 216415 216721 +306
==========================================
- Hits 181836 181589 -247
- Misses 34579 35132 +553 |
Signed-off-by: Ruihang Xia <[email protected]>
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.
REST LGTM
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.
Mostly LGTM
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.
Rest LGTM
/// Maximum number of logs to return. If not provided, it will return all matched logs. | ||
pub limit: Option<usize>, |
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.
Maybe we should set the default to 1000 lines or so. It's easy to write a careless query and result in huge returning lines during debugging. Also, it seems a common way to do it (with default limits).
Explicitly set to 0
to return all lines.
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.
Good suggestion 👍 The default behavior is not going to be placed in the query definition. I'll set one on executing
} | ||
|
||
/// Util function returns a start and optional end DateTime | ||
fn parse_datetime(s: &str) -> Result<(DateTime<Utc>, Option<DateTime<Utc>>)> { |
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.
It looks like a very generic parse function, should it be moved to common-time
?
Same as parse_span
below.
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.
parse_datetime
is not that generic for now as here is the first and only place that accepts both date and timestamp. I'd do a refactor afterward for parse_span
to combine the same piece of logic in the plan rewriter.
* feat: define basic structures and implement TimeFilter Signed-off-by: Ruihang Xia <[email protected]> * document column filter Signed-off-by: Ruihang Xia <[email protected]> * define context Signed-off-by: Ruihang Xia <[email protected]> * change variable name to avoid typo checker Signed-off-by: Ruihang Xia <[email protected]> * change error referring style Signed-off-by: Ruihang Xia <[email protected]> * refine context definition Signed-off-by: Ruihang Xia <[email protected]> --------- Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia [email protected]I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
What's changed and what's your intention?
Define some basic log query structures
Checklist