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 a new
FORMAT
function to the IoTDB query engine, along with the necessary infrastructure to support it. The primary changes include the addition of theFormatColumnTransformer
class, updates to theTableBuiltinScalarFunction
enum, and modifications to various files to incorporate the new function.Major Changes:
New Functionality:
FormatColumnTransformer
class to handle theFORMAT
function in query transformations. (iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/transformation/dag/column/unary/scalar/FormatColumnTransformer.java
)Integration with Query Engine:
TableBuiltinScalarFunction
enum to include the newFORMAT
function. (iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/transformation/dag/column/unary/scalar/TableBuiltinScalarFunction.java
)ColumnTransformerBuilder
to create aFormatColumnTransformer
when theFORMAT
function is used. (iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/relational/ColumnTransformerBuilder.java
) [1] [2]TableMetadataImpl
to ensure the first argument of theFORMAT
function is a char type. (iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableMetadataImpl.java
)Utility Enhancements:
DateTimeUtils
to convert timestamps toLocalDateTime
andZonedDateTime
, which are used by theFormatColumnTransformer
. (iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/DateTimeUtils.java
)Testing:
IoTDBFormatFunctionTableIT
to test theFORMAT
function with various data types. (integration-test/src/test/java/org/apache/iotdb/relational/it/query/old/builtinfunction/scalar/IoTDBFormatFunctionTableIT.java
)##