private static EnumSet<ExtendedCBOProfile> obtainCBOProfiles(QueryProperties queryProperties) {
    EnumSet<ExtendedCBOProfile> profilesCBO = EnumSet.noneOf(ExtendedCBOProfile.class);
    // If the query contains more than one join
    if (queryProperties.getJoinCount() > 1) {
      profilesCBO.add(ExtendedCBOProfile.JOIN_REORDERING);
    }
    // If the query contains windowing processing
    if (queryProperties.hasWindowing()) {
      profilesCBO.add(ExtendedCBOProfile.WINDOWING_POSTPROCESSING);
    }
    return profilesCBO;
  }
Checks whether Calcite can handle the query.

@param queryProperties
@param conf
@param topLevelQB
         Does QB corresponds to top most query block?
@return null if the query can be handled; non-null reason string if it
        cannot be.

        Assumption:<br>
        1. If top level QB is query then everything below it must also be
        Query<br>
        2. Nested Subquery will return false for qbToChk.getIsQuery()
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java