@Override
    public boolean allowsRetry() {
      return true;
    }
Use the legacy optimizer only when the CBO exception is not related to subqueries and views.
ql/src/java/org/apache/hadoop/hive/ql/parse/CBOFallbackStrategy.java