JackieTien97 opened a new pull request, #15977:
URL: https://github.com/apache/iotdb/pull/15977
This pull request introduces a new built-in scalar function, `to_base64`, to
the IoTDB query engine. The function allows encoding `STRING`, `TEXT`, and
`BLOB` data types to Base64 format. Key changes include the implementation of
the function, integration into the query engine, and comprehensive testing.
### Implementation of `to_base64`:
* **Function logic and transformation**:
- Added the `ToBase64ColumnTransformer` class to handle Base64 encoding
for supported data types (`STRING`, `TEXT`, `BLOB`) in unary column
transformations.
* **Integration into the query engine**:
- Updated `ColumnTransformerBuilder` to include logic for processing the
`to_base64` function and returning the appropriate column transformer.
- Modified `TableMetadataImpl` to validate the input arguments for
`to_base64` and ensure only one argument of a supported type is accepted.
- Added `TO_BASE64` to the `TableBuiltinScalarFunction` enumeration to
register the function.
### Testing and validation:
* **Unit tests for `ToBase64ColumnTransformer`**:
- Added extensive tests in `ToBase64ColumnTransformerTest` to verify
functionality for supported data types (`STRING`, `TEXT`, `BLOB`), handling of
null values, multi-row transformations, and selective evaluation.
* **Integration tests**:
- Created `IoTDBToBase64FunctionTableIT` to test the `to_base64` function
in query scenarios, including successful transformations and error handling for
unsupported types.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]