Add Greatest and Least Comparison functions #14755
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces new functionality to support the
GREATEST
andLEAST
scalar functions in the IoTDB query engine. The changes include adding new transformer classes, updating metadata validation, and creating integration tests to verify the new functions.New functionality:
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/transformation/dag/column/multi/GreatestColumnTransformer.java
: Added a new transformer class for theGREATEST
function to determine the maximum value among multiple columns.iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/transformation/dag/column/multi/LeastColumnTransformer.java
: Added a new transformer class for theLEAST
function to determine the minimum value among multiple columns.Metadata validation:
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableMetadataImpl.java
: Updated metadata validation to ensure that theGREATEST
andLEAST
functions have at least two arguments and all arguments are of the same type. [1] [2]Integration tests:
integration-test/src/test/java/org/apache/iotdb/relational/it/query/old/query/IoTDBGreatestLeastTableIT.java
: Created a new integration test class to verify the behavior of theGREATEST
andLEAST
functions across different data types and scenarios.