public boolean hasTableSampleRecursive() {
    if (!qbp.getNameToSample().isEmpty()) {
      return true;
    }
    
    for (QBExpr qbExpr: aliasToSubq.values()) {
      if (qbExpr.getQB() != null && qbExpr.getQB().hasTableSampleRecursive()) {
        return true;
      }
    }
    
    return false;
  }
Set to true in SemanticAnalyzer.getMetadataForDestFile,
if destination is a file and query is not CTAS
@return
ql/src/java/org/apache/hadoop/hive/ql/parse/QB.java