JackieTien97 opened a new pull request, #17102:
URL: https://github.com/apache/iotdb/pull/17102
This pull request enhances the integration tests for the `first` and
`first_by` aggregation functions, especially around handling time columns and
timestamp-type fields. It adds new test cases to verify priority and fallback
logic for time columns, ensures proper error handling when no valid time column
is present, and improves the robustness of test coverage for both base and
joined tables. Additionally, a minor refactor in the data generation utility
ensures that time columns are excluded where appropriate.
Key changes include:
### Test Coverage and Logic Improvements
* Added new test cases in `IoTDBAggregationFirstIT.java` and
`IoTDBAggregationFirstByIT.java` to verify:
- Priority of time columns versus timestamp-type fields.
- Fallback to timestamp columns when no explicit time column exists.
- Correct error reporting when neither time nor timestamp columns are
present.
[[1]](diffhunk://#diff-eedc3fcbaee088e7879b1de9e9007430e20970d8e5a32e1e93e610790173c484R101-R153)
[[2]](diffhunk://#diff-eedc3fcbaee088e7879b1de9e9007430e20970d8e5a32e1e93e610790173c484R166)
[[3]](diffhunk://#diff-eedc3fcbaee088e7879b1de9e9007430e20970d8e5a32e1e93e610790173c484R186-R220)
[[4]](diffhunk://#diff-eedc3fcbaee088e7879b1de9e9007430e20970d8e5a32e1e93e610790173c484R254-R287)
[[5]](diffhunk://#diff-eedc3fcbaee088e7879b1de9e9007430e20970d8e5a32e1e93e610790173c484R315-R347)
[[6]](diffhunk://#diff-85d75bdfeb2675b2a2f876997ea8e0d4ed09d6601fb4f09322c64ce9b4709e5fR114-R190)
* Extended test scenarios to cover queries on both base tables and joined
tables, including cases with explicit and implicit time columns, and grouped
queries.
[[1]](diffhunk://#diff-eedc3fcbaee088e7879b1de9e9007430e20970d8e5a32e1e93e610790173c484R166)
[[2]](diffhunk://#diff-eedc3fcbaee088e7879b1de9e9007430e20970d8e5a32e1e93e610790173c484R186-R220)
[[3]](diffhunk://#diff-eedc3fcbaee088e7879b1de9e9007430e20970d8e5a32e1e93e610790173c484R254-R287)
[[4]](diffhunk://#diff-eedc3fcbaee088e7879b1de9e9007430e20970d8e5a32e1e93e610790173c484R315-R347)
[[5]](diffhunk://#diff-6acbacdbec67548aa5dbce8dd7f159852e4d20cb0293b47287a9e597bd80e164R133-R170)
[[6]](diffhunk://#diff-b70a6dc6495f88f269b97402d542efa858df8b681e86a7336d85736621b560baR120)
[[7]](diffhunk://#diff-b70a6dc6495f88f269b97402d542efa858df8b681e86a7336d85736621b560baR139-R175)
[[8]](diffhunk://#diff-85d75bdfeb2675b2a2f876997ea8e0d4ed09d6601fb4f09322c64ce9b4709e5fR114-R190)
[[9]](diffhunk://#diff-85d75bdfeb2675b2a2f876997ea8e0d4ed09d6
601fb4f09322c64ce9b4709e5fR199-R200)
[[10]](diffhunk://#diff-85d75bdfeb2675b2a2f876997ea8e0d4ed09d6601fb4f09322c64ce9b4709e5fR209-R210)
[[11]](diffhunk://#diff-85d75bdfeb2675b2a2f876997ea8e0d4ed09d6601fb4f09322c64ce9b4709e5fR232-R270)
### Data Generation Utility Refactor
* Updated `TsFileTableGenerator.java` to exclude the time column from
measurement schemas and column categories when generating data, ensuring that
test data correctly reflects the intended table structure for time-related
queries.
[[1]](diffhunk://#diff-bcd13bb3fce48eb1fabec4f0cddab3b4af55a71482716d257a6e9784063ec33bR40)
[[2]](diffhunk://#diff-bcd13bb3fce48eb1fabec4f0cddab3b4af55a71482716d257a6e9784063ec33bR85-R108)
[[3]](diffhunk://#diff-bcd13bb3fce48eb1fabec4f0cddab3b4af55a71482716d257a6e9784063ec33bL101-R117)
### Test Utility Enhancements
* Added helper methods (`runTest2`, `runTest3`) to streamline repeated test
logic for different query forms in `IoTDBAggregationFirstByIT.java`.
These changes collectively improve the reliability and completeness of
integration tests for time-aware aggregation functions in IoTDB.
--
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]