iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

fix bugs in AlignByDeviceOrderByLimitOffsetTest#orderByTimeWithOffsetTest

Open chihyu0917 opened this issue 2 months ago • 0 comments

Description

Motivation

The orderByTimeWithOffsetTest unit-test asserted that the subtree rooted at the LimitNode must contain at least one ExchangeNode. On clusters where all relevant data-regions happen to reside on the same DataNode the query planner correctly omits remote fragments, thus generating zero ExchangeNodes. With NonDex or different region layouts this legitimate plan caused the test to fail nondeterministically.

Design & Implementation

  • Accepts 0 – 3 ExchangeNodes—the upper bound still guards against impossible fan-outs while allowing the “all-local” case.
  • All existing checks for the presence of the outer LimitNode, inner TopKNode, SingleDeviceViewNodes, and correct push-down of OFFSET + LIMIT remain untouched.

Reproduce the error

mvn -pl iotdb-core/datanode edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=org.apache.iotdb.db.queryengine.plan.planner.distribution.AlignByDeviceOrderByLimitOffsetTest#orderByTimeWithOffsetTest

This PR has:

  • [ ] been self-reviewed.
    • [ ] concurrent read
    • [ ] concurrent write
    • [ ] concurrent read and write
  • [ ] added documentation for new or modified features or behaviors.
  • [ ] added Javadocs for most classes and all non-trivial methods.
  • [ ] added or updated version, license, or notice information
  • [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage.
  • [ ] added integration tests.
  • [ ] been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

chihyu0917 avatar Oct 27 '25 04:10 chihyu0917