-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support second and third parameter of read_object are not constant #16967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 pull request enhances the READ_OBJECT function to support dynamic offset and length parameters from columns, rather than only accepting constant literal values. This improvement increases flexibility by allowing runtime-determined values for these parameters.
- Added
ReadObject2ColumnTransformerandReadObject3ColumnTransformerclasses to handle dynamic parameter scenarios - Refactored
ReadObjectColumnTransformerto expose static methods for code reuse across transformers - Updated
ColumnTransformerBuilderto detect and route to appropriate transformer based on parameter types (literal vs column) - Extended
OperatorTreeGeneratorto support linear fill for OBJECT data type
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ReadObjectColumnTransformer.java | Refactored transform and readObject methods to be static with expanded parameters to support reuse by new transformer classes |
| ReadObject2ColumnTransformer.java | New binary transformer handling READ_OBJECT with dynamic offset parameter (defaults length to -1 for reading to end) |
| ReadObject3ColumnTransformer.java | New ternary transformer handling READ_OBJECT with both dynamic offset and length parameters |
| ColumnTransformerBuilder.java | Updated to distinguish between literal and column-based arguments for READ_OBJECT and instantiate appropriate transformer |
| OperatorTreeGenerator.java | Added OBJECT type to linear fill identity handling alongside TEXT, STRING, and BLOB types |
| IoTDBObjectQueryIT.java | Expanded test coverage with additional columns (l1, l2) and new test cases for dynamic parameters and linear fill functionality |
| IoTDBObjectQuery2IT.java | Renamed test class from IoTDBObjectQueryIT2 to IoTDBObjectQuery2IT for naming consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...che/iotdb/db/queryengine/transformation/dag/column/ternary/ReadObject3ColumnTransformer.java
Outdated
Show resolved
Hide resolved
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #16967 +/- ##
============================================
+ Coverage 39.32% 39.34% +0.01%
Complexity 212 212
============================================
Files 5053 5055 +2
Lines 337216 337314 +98
Branches 42923 42940 +17
============================================
+ Hits 132603 132708 +105
+ Misses 204613 204606 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



This pull request enhances the handling of the
READ_OBJECTfunction in the query engine by adding support for dynamic offset and length parameters, improving test coverage, and making related codebase adjustments. The main changes include introducing new column transformers to support dynamic arguments, updating the query planner, and extending integration tests to verify the new functionality.Enhancements to
READ_OBJECTfunction support:ReadObject2ColumnTransformerandReadObject3ColumnTransformerclasses to handleREAD_OBJECTwith dynamic offset and length parameters, enabling the function to accept column-based arguments instead of just literals. [1] [2]ColumnTransformerBuilderto utilize the new transformers whenREAD_OBJECTis called with column arguments, and refactored the logic to distinguish between literal and column inputs for offset and length. [1] [2] [3]Query planner and type handling improvements:
OBJECT, ensuring consistent behavior with other supported types.Test and codebase updates:
IoTDBObjectQueryIT.javato cover various usages ofREAD_OBJECTwith dynamic parameters and linear fill, verifying correct results for the new scenarios. [1] [2]IoTDBObjectQueryIT2.javatoIoTDBObjectQuery2IT.javafor consistency with naming conventions.Refactoring and API improvements:
ReadObjectColumnTransformerto expose itstransformandreadObjectmethods as static, enabling reuse by the new transformer classes and supporting the extended API. [1] [2]