org.apache.hadoop.hive.ql.parse.QBParseInfo.getHints()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中org.apache.hadoop.hive.ql.parse.QBParseInfo.getHints方法的一些代码示例,展示了QBParseInfo.getHints的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QBParseInfo.getHints方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.parse.QBParseInfo
类名称:QBParseInfo
方法名:getHints

QBParseInfo.getHints介绍

暂无

代码示例

代码示例来源:origin: apache/hive

public void getHintsFromQB(QB qb, List<ASTNode> hints) {
 if (qb.getParseInfo().getHints() != null) {
  hints.add(qb.getParseInfo().getHints());
 }
 Set<String> aliases = qb.getSubqAliases();
 for (String alias : aliases) {
  getHintsFromQB(qb.getSubqForAlias(alias), hints);
 }
}

代码示例来源:origin: apache/hive

private List<String> getMapSideJoinTables(QB qb) {
 List<String> cols = new ArrayList<String>();
 ASTNode hints = qb.getParseInfo().getHints();
 for (int pos = 0; pos < hints.getChildCount(); pos++) {
  ASTNode hint = (ASTNode) hints.getChild(pos);
  if (((ASTNode) hint.getChild(0)).getToken().getType() == HintParser.TOK_MAPJOIN) {
   // the user has specified to ignore mapjoin hint
   if (!conf.getBoolVar(HiveConf.ConfVars.HIVEIGNOREMAPJOINHINT)
     && !conf.getVar(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez")) {
    ASTNode hintTblNames = (ASTNode) hint.getChild(1);
    int numCh = hintTblNames.getChildCount();
    for (int tblPos = 0; tblPos < numCh; tblPos++) {
     String tblName = ((ASTNode) hintTblNames.getChild(tblPos)).getText()
       .toLowerCase();
     if (!cols.contains(tblName)) {
      cols.add(tblName);
     }
    }
   }
   else {
    queryProperties.setMapJoinRemoved(true);
   }
  }
 }
 return cols;
}

代码示例来源:origin: apache/hive

private void parseStreamTables(QBJoinTree joinTree, QB qb) {
 List<String> streamAliases = joinTree.getStreamAliases();
 for (Node hintNode : qb.getParseInfo().getHints().getChildren()) {
  ASTNode hint = (ASTNode) hintNode;
  if (hint.getChild(0).getType() == HintParser.TOK_STREAMTABLE) {
   for (int i = 0; i < hint.getChild(1).getChildCount(); i++) {
    if (streamAliases == null) {
     streamAliases = new ArrayList<String>();
    }
    streamAliases.add(hint.getChild(1).getChild(i).getText());
   }
  }
 }
 joinTree.setStreamAliases(streamAliases);
}

代码示例来源:origin: apache/drill

private List<String> getMapSideJoinTables(QB qb) {
 List<String> cols = new ArrayList<String>();
 ASTNode hints = qb.getParseInfo().getHints();
 for (int pos = 0; pos < hints.getChildCount(); pos++) {
  ASTNode hint = (ASTNode) hints.getChild(pos);
  if (((ASTNode) hint.getChild(0)).getToken().getType() == HintParser.TOK_MAPJOIN) {
   // the user has specified to ignore mapjoin hint
   if (!conf.getBoolVar(HiveConf.ConfVars.HIVEIGNOREMAPJOINHINT)
     && !conf.getVar(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez")) {
    ASTNode hintTblNames = (ASTNode) hint.getChild(1);
    int numCh = hintTblNames.getChildCount();
    for (int tblPos = 0; tblPos < numCh; tblPos++) {
     String tblName = ((ASTNode) hintTblNames.getChild(tblPos)).getText()
       .toLowerCase();
     if (!cols.contains(tblName)) {
      cols.add(tblName);
     }
    }
   }
   else {
    queryProperties.setMapJoinRemoved(true);
   }
  }
 }
 return cols;
}

代码示例来源:origin: apache/hive

if ((qb.getParseInfo().getHints() != null)
  && !(conf.getVar(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez"))) {
 LOG.info("STREAMTABLE hint honored.");

代码示例来源:origin: apache/drill

private void parseStreamTables(QBJoinTree joinTree, QB qb) {
 List<String> streamAliases = joinTree.getStreamAliases();
 for (Node hintNode : qb.getParseInfo().getHints().getChildren()) {
  ASTNode hint = (ASTNode) hintNode;
  if (hint.getChild(0).getType() == HintParser.TOK_STREAMTABLE) {
   for (int i = 0; i < hint.getChild(1).getChildCount(); i++) {
    if (streamAliases == null) {
     streamAliases = new ArrayList<String>();
    }
    streamAliases.add(hint.getChild(1).getChild(i).getText());
   }
  }
 }
 joinTree.setStreamAliases(streamAliases);
}

代码示例来源:origin: apache/drill

if ((qb.getParseInfo().getHints() != null)
  && !(conf.getVar(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez"))) {
 LOG.info("STREAMTABLE hint honored.");

代码示例来源:origin: apache/hive

if (qb.getParseInfo().getHints() != null) {
 List<String> mapSideTables = getMapSideJoinTables(qb);
 List<String> mapAliases = joinTree.getMapAliases();

代码示例来源:origin: apache/drill

if (qb.getParseInfo().getHints() != null) {
 List<String> mapSideTables = getMapSideJoinTables(qb);
 List<String> mapAliases = joinTree.getMapAliases();

代码示例来源:origin: apache/hive

if (getQB().getParseInfo().getHints() != null) {
 LOG.warn("Hints are not null in the optimized tree; "
   + "after CBO " + getQB().getParseInfo().getHints().dump());
} else {
 LOG.debug("Propagating hints to QB: " + oldHints);

代码示例来源:origin: apache/lens

builder.append("\n joinExpr: ").append(parseInfo.getJoinExpr().dump());
builder.append("\n hints: ").append(parseInfo.getHints());
builder.append("\n aliasToSrc: ");
for (String alias : tabAliases) {

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

private List<String> getMapSideJoinTables(QB qb) {
 List<String> cols = new ArrayList<String>();
 ASTNode hints = qb.getParseInfo().getHints();
 for (int pos = 0; pos < hints.getChildCount(); pos++) {
  ASTNode hint = (ASTNode) hints.getChild(pos);
  if (((ASTNode) hint.getChild(0)).getToken().getType() == HiveParser.TOK_MAPJOIN) {
   ASTNode hintTblNames = (ASTNode) hint.getChild(1);
   int numCh = hintTblNames.getChildCount();
   for (int tblPos = 0; tblPos < numCh; tblPos++) {
    String tblName = ((ASTNode) hintTblNames.getChild(tblPos)).getText()
      .toLowerCase();
    if (!cols.contains(tblName)) {
     cols.add(tblName);
    }
   }
  }
 }
 return cols;
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

private List<String> getMapSideJoinTables(QB qb) {
 List<String> cols = new ArrayList<String>();
 ASTNode hints = qb.getParseInfo().getHints();
 for (int pos = 0; pos < hints.getChildCount(); pos++) {
  ASTNode hint = (ASTNode) hints.getChild(pos);
  if (((ASTNode) hint.getChild(0)).getToken().getType() == HiveParser.TOK_MAPJOIN) {
   // the user has specified to ignore mapjoin hint
   if (!conf.getBoolVar(HiveConf.ConfVars.HIVEIGNOREMAPJOINHINT)
     && !conf.getVar(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez")) {
    ASTNode hintTblNames = (ASTNode) hint.getChild(1);
    int numCh = hintTblNames.getChildCount();
    for (int tblPos = 0; tblPos < numCh; tblPos++) {
     String tblName = ((ASTNode) hintTblNames.getChild(tblPos)).getText()
       .toLowerCase();
     if (!cols.contains(tblName)) {
      cols.add(tblName);
     }
    }
   }
   else {
    queryProperties.setMapJoinRemoved(true);
   }
  }
 }
 return cols;
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

private void parseStreamTables(QBJoinTree joinTree, QB qb) {
 List<String> streamAliases = joinTree.getStreamAliases();
 for (Node hintNode : qb.getParseInfo().getHints().getChildren()) {
  ASTNode hint = (ASTNode) hintNode;
  if (hint.getChild(0).getType() == HiveParser.TOK_STREAMTABLE) {
   for (int i = 0; i < hint.getChild(1).getChildCount(); i++) {
    if (streamAliases == null) {
     streamAliases = new ArrayList<String>();
    }
    streamAliases.add(hint.getChild(1).getChild(i).getText());
   }
  }
 }
 joinTree.setStreamAliases(streamAliases);
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

private void parseStreamTables(QBJoinTree joinTree, QB qb) {
 List<String> streamAliases = joinTree.getStreamAliases();
 for (Node hintNode : qb.getParseInfo().getHints().getChildren()) {
  ASTNode hint = (ASTNode) hintNode;
  if (hint.getChild(0).getType() == HiveParser.TOK_STREAMTABLE) {
   for (int i = 0; i < hint.getChild(1).getChildCount(); i++) {
    if (streamAliases == null) {
     streamAliases = new ArrayList<String>();
    }
    streamAliases.add(hint.getChild(1).getChild(i).getText());
   }
  }
 }
 joinTree.setStreamAliases(streamAliases);
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

/**
 * Check for HOLD_DDLTIME hint.
 * @param qb
 * @return true if HOLD_DDLTIME is set, false otherwise.
 */
private boolean checkHoldDDLTime(QB qb) {
 ASTNode hints = qb.getParseInfo().getHints();
 if (hints == null) {
  return false;
 }
 for (int pos = 0; pos < hints.getChildCount(); pos++) {
  ASTNode hint = (ASTNode) hints.getChild(pos);
  if (((ASTNode) hint.getChild(0)).getToken().getType() == HiveParser.TOK_HOLD_DDLTIME) {
   return true;
  }
 }
 return false;
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

if (qb.getParseInfo().getHints() != null) {
 parseStreamTables(joinTree, qb);

代码示例来源:origin: com.facebook.presto.hive/hive-apache

/**
 * Check for HOLD_DDLTIME hint.
 *
 * @param qb
 * @return true if HOLD_DDLTIME is set, false otherwise.
 */
private boolean checkHoldDDLTime(QB qb) {
 ASTNode hints = qb.getParseInfo().getHints();
 if (hints == null) {
  return false;
 }
 for (int pos = 0; pos < hints.getChildCount(); pos++) {
  ASTNode hint = (ASTNode) hints.getChild(pos);
  if (((ASTNode) hint.getChild(0)).getToken().getType() == HiveParser.TOK_HOLD_DDLTIME) {
   return true;
  }
 }
 return false;
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

if ((qb.getParseInfo().getHints() != null)
  && !(conf.getVar(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez"))) {
 LOG.info("STREAMTABLE hint honored.");

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

.getParseInfo().getHints()));

相关文章

微信公众号

最新文章

更多

QBParseInfo类方法