Skip to content

Conversation

@Simon9997
Copy link
Contributor

  1. support time range expr in stream query.
  2. support where condition in stream notify.

Description

Please briefly describe the code changes in this pull request.

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

1. support time range expr in stream query.
2. support where condition in stream notify.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements support for time range expressions in stream queries and adds the ability to specify a where condition for stream notify. Key changes include cloning and propagating a new time range node (QUERY_NODE_TIME_RANGE) across planner nodes, updates to node cloning/serialization logic, and modifications to built-in functions to support pseudo column functions without parameters.

Reviewed Changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
source/libs/planner/src/planPhysiCreater.c Clones and attaches the new time range node for table scans.
source/libs/planner/src/planLogicCreater.c Clones the time range node from the select statement for scan logic.
source/libs/parser/src/parTranslater.c Implements filtering and extraction of time range conditions and modifies error handling with the new time range support.
source/libs/parser/src/parAstCreater.c Updates function node creation and stream notify options to incorporate a new "where" field.
source/libs/nodes/* Adds handling for QUERY_NODE_TIME_RANGE in node creation, destruction, cloning, and JSON conversion functions.
source/libs/function/src/builtins.c Adjusts built-in pseudo column functions (_tcurrent_ts, _twend, etc.) to use 0 parameters.
include/libs/* Updates header files to reflect changes in node structures and function prototypes for time range handling.
include/common/tmsg.h Adds support for the new QUERY_NODE_TIME_RANGE type.
Files not reviewed (1)
  • source/libs/parser/inc/sql.y: Language not supported
Comments suppressed due to low confidence (3)

include/libs/nodes/querynodes.h:509

  • [nitpick] Consider renaming or documenting the 'pTimeRange' field to clearly distinguish it from 'timeRange' fields used elsewhere, ensuring consistency across the codebase.
SNode*          pTimeRange; // STimeRangeNode for create stream

source/libs/nodes/src/nodesUtilFuncs.c:1139

  • [nitpick] It may be beneficial to check whether pTimeRange->pStart and pTimeRange->pEnd are non-null before calling nodesDestroyNode to avoid potential null pointer dereferences.
case QUERY_NODE_TIME_RANGE: { STimeRangeNode* pTimeRange = (STimeRangeNode*)pNode; nodesDestroyNode((SNode*)pTimeRange->pStart); nodesDestroyNode((SNode*)pTimeRange->pEnd); break; }

source/libs/function/src/builtins.c:5864

  • The change to set the parameter count for the _tcurrent_ts and related functions to 0 should be confirmed against the documentation and tests to ensure backward compatibility and proper usage.
.parameters = {.minParamNum = 0, .maxParamNum = 0, .paramInfoPattern = 0,

@Simon9997 Simon9997 merged commit c6462c1 into feat/TS-6100-3.0 Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants