Skip to content

Conversation

JackieTien97
Copy link
Contributor

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.

…porting STRING, TEXT, and BLOB types, with full integration, unit tests, and integration tests.
Copy link

Copy link

codecov bot commented Jul 20, 2025

Codecov Report

Attention: Patch coverage is 62.06897% with 11 lines in your changes missing coverage. Please review.

Project coverage is 39.02%. Comparing base (c17ca38) to head (5d00635).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...execution/relational/ColumnTransformerBuilder.java 0.00% 6 Missing ⚠️
...ne/plan/relational/metadata/TableMetadataImpl.java 37.50% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #15977      +/-   ##
============================================
+ Coverage     39.00%   39.02%   +0.01%     
  Complexity      198      198              
============================================
  Files          4846     4849       +3     
  Lines        315683   315927     +244     
  Branches      39740    39778      +38     
============================================
+ Hits         123142   123278     +136     
- Misses       192541   192649     +108     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant