public boolean areCompatibleSections(
      List<Section> querySections, List<Section> dataSections, boolean checkLength) {
    if (querySections.size() != dataSections.size()) {
      return false;
    }

    if (this.queryLength != null && checkLength) {
      Section lastDataSection = dataSections.get(dataSections.size() - 1);
      double maxMatchLength =
          lastDataSection.getPoints().get(lastDataSection.getPoints().size() - 1).getOrigX()
              - dataSections.get(0).getPoints().get(0).getOrigX()
              + this.queryLength * this.queryLengthTolerance;
      double minMatchLength =
          (dataSections.size() == 1
                  ? 0
                  : lastDataSection.getPoints().get(0).getOrigX()
                      - dataSections
                          .get(0)
                          .getPoints()
                          .get(dataSections.get(0).getPoints().size() - 1)
                          .getOrigX())
              - this.queryLength * this.queryLengthTolerance;
      if (this.queryLength > maxMatchLength || this.queryLength < minMatchLength) {
        return false;
      }
    }

    double incompatibleSections = 0;
    for (int j = 0; j < querySections.size(); j++) {
      if (querySections.get(j).getSign() != 0
          && querySections.get(j).getSign() != dataSections.get(j).getSign()) {
        incompatibleSections++;
      }
    }
    return incompatibleSections / querySections.size()
        <= PatternMatchConfig.QUERY_SIGN_MAXIMUM_TOLERABLE_DIFFERENT_SIGN_SECTIONS;
  }
Given a list of tangents it divides the list of tangents in a list of sections. Each section
shares the same tangent signs (a section could be an increasing curve or a decreasing curve,
but not both)

@return Array of sections.
library-udf/src/main/java/org/apache/iotdb/library/match/PatternExecutor.java