-
Notifications
You must be signed in to change notification settings - Fork 5k
fix: perf test errors #33378
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
base: 3.0
Are you sure you want to change the base?
fix: perf test errors #33378
Conversation
Summary of ChangesHello @dapan1121, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses several issues and introduces enhancements primarily focused on stream calculation queries and their interaction with window functions and timestamp handling. It refines how the system processes queries without a 'FROM' clause in stream contexts, correctly identifies new timestamp functions, and includes specific fixes to resolve performance test errors, alongside general improvements to error handling within the planner. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces fixes for performance tests, primarily by enhancing stream processing capabilities, especially for queries without a FROM clause and handling new timestamp-related placeholder functions. The changes include refactoring for better error handling and readability. My review focuses on improving maintainability by reducing code duplication, enhancing readability of complex conditions, and addressing potential issues from commented-out code.
| /* agg could meet the requirement when the primary key is const like function, so this check may be failed | ||
| if (requirement > DATA_ORDER_LEVEL_NONE && (NULL != pAgg->pGroupKeys || !pAgg->onlyHasKeepOrderFunc)) { | ||
| planError( | ||
| "The output of aggregate cannot meet the requirements(%s) of the upper operator. " | ||
| "Illegal statement, should be intercepted in parser", | ||
| dataOrderStr(requirement)); | ||
| return TSDB_CODE_PLAN_INTERNAL_ERROR; | ||
| } | ||
| */ |
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.
The check for requirement > DATA_ORDER_LEVEL_NONE has been commented out. While the comment provides some context, simply removing the check might introduce regressions. A more robust approach would be to refine the condition to correctly handle the case of constant primary keys, rather than disabling the check entirely. For example, you could add a check to see if the primary key is a constant-like function. Could you please consider a more precise condition?
| pTask->historyCalcStarted = true; | ||
|
|
||
| if (pTask->fillHistory) { | ||
| if (pTask->fillHistory || pTask->fillHistoryFirst) { |
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.
The condition pTask->fillHistory || pTask->fillHistoryFirst is duplicated in stRealtimeGroupInit (line 6988). To improve maintainability and avoid future inconsistencies, consider creating a helper function or a macro to encapsulate this logic. For example:
static inline bool stTriggerTaskShouldFillHistory(SStreamTriggerTask *pTask) {
return pTask->fillHistory || pTask->fillHistoryFirst;
}Then you can use if (stTriggerTaskShouldFillHistory(pTask)) in both places.
| } | ||
| #endif | ||
| if (pTask->fillHistory) { | ||
| if (pTask->fillHistory || pTask->fillHistoryFirst) { |
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.
| } else if (FUNCTION_TYPE_WSTART == pFunc->funcType || FUNCTION_TYPE_WEND == pFunc->funcType || | ||
| FUNCTION_TYPE_IROWTS == pFunc->funcType || FUNCTION_TYPE_IROWTS_ORIGIN == pFunc->funcType || | ||
| FUNCTION_TYPE_FORECAST_ROWTS == pFunc->funcType || FUNCTION_TYPE_IMPUTATION_ROWTS == pFunc->funcType) { | ||
| FUNCTION_TYPE_FORECAST_ROWTS == pFunc->funcType || FUNCTION_TYPE_IMPUTATION_ROWTS == pFunc->funcType || | ||
| FUNCTION_TYPE_TPREV_TS == pFunc->funcType || FUNCTION_TYPE_TCURRENT_TS == pFunc->funcType || | ||
| FUNCTION_TYPE_TNEXT_TS == pFunc->funcType || FUNCTION_TYPE_TWSTART == pFunc->funcType || | ||
| FUNCTION_TYPE_TWEND == pFunc->funcType || FUNCTION_TYPE_TPREV_LOCALTIME == pFunc->funcType || | ||
| FUNCTION_TYPE_TNEXT_LOCALTIME == pFunc->funcType || FUNCTION_TYPE_TLOCALTIME == pFunc->funcType) { |
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.
| static int32_t createWindowLogicNodeByExternalWithoutFrom(SLogicPlanContext* pCxt, SExternalWindowNode* pExternal, | ||
| SSelectStmt* pSelect, SLogicNode** pLogicNode) { | ||
| SWindowLogicNode* pWindow = NULL; | ||
| int32_t code = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW, (SNode**)&pWindow); | ||
| if (NULL == pWindow) { | ||
| return code; | ||
| } | ||
|
|
||
| pWindow->winType = WINDOW_TYPE_EXTERNAL; | ||
| pWindow->node.groupAction = GROUP_ACTION_NONE; | ||
| pWindow->node.requireDataOrder = DATA_ORDER_LEVEL_GLOBAL; | ||
| pWindow->node.resultDataOrder = DATA_ORDER_LEVEL_GLOBAL; | ||
| pWindow->isPartTb = 0; | ||
| pWindow->pTspk = NULL; | ||
|
|
||
| return createExternalWindowLogicNodeFinalize(pCxt, pSelect, pWindow, pLogicNode); | ||
| } |
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.
| static int32_t createWindowPhysiNodeFinalize(SPhysiPlanContext* pCxt, SNodeList* pChildren, SWindowPhysiNode* pWindow, | ||
| SWindowLogicNode* pWindowLogicNode) { | ||
| int32_t code = TSDB_CODE_SUCCESS; | ||
| int32_t lino = 0; |
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.
|
|
Description
Please briefly describe the code changes in this pull request.
Checklist
Please check the items in the checklist if applicable.