org.apache.hadoop.hive.ql.plan.api.Query.getQueryId()方法的使用及代码示例

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

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

Query.getQueryId介绍

暂无

代码示例

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

public String getJSONQuery(org.apache.hadoop.hive.ql.plan.api.Query query) {
 StringBuilder sb = new StringBuilder();
 sb.append("{");
 sb.append(getJSONKeyValue("queryId", query.getQueryId()));
 sb.append(getJSONKeyValue("queryType", query.getQueryType()));
 sb.append(getJSONKeyValue("queryAttributes", getJSONMap(query.getQueryAttributes())));
 sb.append(getJSONKeyValue("queryCounters", getJSONMap(query.getQueryCounters())));
 sb.append(getJSONKeyValue("stageGraph", getJSONGraph(query.getStageGraph())));
 // stageList
 List<String> stageList = new ArrayList<String>();
 if (query.getStageList() != null) {
  for (org.apache.hadoop.hive.ql.plan.api.Stage stage : query.getStageList()) {
   stageList.add(getJSONStage(stage));
  }
 }
 sb.append(getJSONKeyValue("stageList", getJSONList(stageList)));
 sb.append(getJSONKeyValue("done", query.isDone()));
 sb.append(getJSONKeyValue("started", query.isStarted()));
 sb.deleteCharAt(sb.length() - 1);
 sb.append("}");
 return sb.toString();
}

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

public String getJSONQuery(org.apache.hadoop.hive.ql.plan.api.Query query) {
 StringBuilder sb = new StringBuilder();
 sb.append("{");
 sb.append(getJSONKeyValue("queryId", query.getQueryId()));
 sb.append(getJSONKeyValue("queryType", query.getQueryType()));
 sb.append(getJSONKeyValue("queryAttributes", getJSONMap(query.getQueryAttributes())));
 sb.append(getJSONKeyValue("queryCounters", getJSONMap(query.getQueryCounters())));
 sb.append(getJSONKeyValue("stageGraph", getJSONGraph(query.getStageGraph())));
 // stageList
 List<String> stageList = new ArrayList<String>();
 if (query.getStageList() != null) {
  for (org.apache.hadoop.hive.ql.plan.api.Stage stage : query.getStageList()) {
   stageList.add(getJSONStage(stage));
  }
 }
 sb.append(getJSONKeyValue("stageList", getJSONList(stageList)));
 sb.append(getJSONKeyValue("done", query.isDone()));
 sb.append(getJSONKeyValue("started", query.isStarted()));
 sb.deleteCharAt(sb.length() - 1);
 sb.append("}");
 return sb.toString();
}

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

public Object getFieldValue(_Fields field) {
 switch (field) {
 case QUERY_ID:
  return getQueryId();
 case QUERY_TYPE:
  return getQueryType();
 case QUERY_ATTRIBUTES:
  return getQueryAttributes();
 case QUERY_COUNTERS:
  return getQueryCounters();
 case STAGE_GRAPH:
  return getStageGraph();
 case STAGE_LIST:
  return getStageList();
 case DONE:
  return isDone();
 case STARTED:
  return isStarted();
 }
 throw new IllegalStateException();
}

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

query.setStarted(started.contains(query.getQueryId()));
query.setDone(done.contains(query.getQueryId()));
if (query.getStageList() != null) {
 for (org.apache.hadoop.hive.ql.plan.api.Stage stage : query

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

public Object getFieldValue(_Fields field) {
 switch (field) {
 case QUERY_ID:
  return getQueryId();
 case QUERY_TYPE:
  return getQueryType();
 case QUERY_ATTRIBUTES:
  return getQueryAttributes();
 case QUERY_COUNTERS:
  return getQueryCounters();
 case STAGE_GRAPH:
  return getStageGraph();
 case STAGE_LIST:
  return getStageList();
 case DONE:
  return isDone();
 case STARTED:
  return isStarted();
 }
 throw new IllegalStateException();
}

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

query.setStarted(started.contains(query.getQueryId()));
query.setDone(done.contains(query.getQueryId()));
if (query.getStageList() != null) {
 for (org.apache.hadoop.hive.ql.plan.api.Stage stage : query

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

public String getJSONQuery(org.apache.hadoop.hive.ql.plan.api.Query query) {
 StringBuilder sb = new StringBuilder();
 sb.append("{");
 sb.append(getJSONKeyValue("queryId", query.getQueryId()));
 sb.append(getJSONKeyValue("queryType", query.getQueryType()));
 sb.append(getJSONKeyValue("queryAttributes", getJSONMap(query.getQueryAttributes())));
 sb.append(getJSONKeyValue("queryCounters", getJSONMap(query.getQueryCounters())));
 sb.append(getJSONKeyValue("stageGraph", getJSONGraph(query.getStageGraph())));
 // stageList
 List<String> stageList = new ArrayList<String>();
 if (query.getStageList() != null) {
  for (org.apache.hadoop.hive.ql.plan.api.Stage stage : query.getStageList()) {
   stageList.add(getJSONStage(stage));
  }
 }
 sb.append(getJSONKeyValue("stageList", getJSONList(stageList)));
 sb.append(getJSONKeyValue("done", query.isDone()));
 sb.append(getJSONKeyValue("started", query.isStarted()));
 sb.deleteCharAt(sb.length() - 1);
 sb.append("}");
 return sb.toString();
}

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

public String getJSONQuery(org.apache.hadoop.hive.ql.plan.api.Query query) {
 StringBuilder sb = new StringBuilder();
 sb.append("{");
 sb.append(getJSONKeyValue("queryId", query.getQueryId()));
 sb.append(getJSONKeyValue("queryType", query.getQueryType()));
 sb.append(getJSONKeyValue("queryAttributes", getJSONMap(query.getQueryAttributes())));
 sb.append(getJSONKeyValue("queryCounters", getJSONMap(query.getQueryCounters())));
 sb.append(getJSONKeyValue("stageGraph", getJSONGraph(query.getStageGraph())));
 // stageList
 List<String> stageList = new ArrayList<String>();
 if (query.getStageList() != null) {
  for (org.apache.hadoop.hive.ql.plan.api.Stage stage : query.getStageList()) {
   stageList.add(getJSONStage(stage));
  }
 }
 sb.append(getJSONKeyValue("stageList", getJSONList(stageList)));
 sb.append(getJSONKeyValue("done", query.isDone()));
 sb.append(getJSONKeyValue("started", query.isStarted()));
 sb.deleteCharAt(sb.length() - 1);
 sb.append("}");
 return sb.toString();
}

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

public Object getFieldValue(_Fields field) {
 switch (field) {
 case QUERY_ID:
  return getQueryId();
 case QUERY_TYPE:
  return getQueryType();
 case QUERY_ATTRIBUTES:
  return getQueryAttributes();
 case QUERY_COUNTERS:
  return getQueryCounters();
 case STAGE_GRAPH:
  return getStageGraph();
 case STAGE_LIST:
  return getStageList();
 case DONE:
  return new Boolean(isDone());
 case STARTED:
  return new Boolean(isStarted());
 }
 throw new IllegalStateException();
}

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

public Object getFieldValue(_Fields field) {
 switch (field) {
 case QUERY_ID:
  return getQueryId();
 case QUERY_TYPE:
  return getQueryType();
 case QUERY_ATTRIBUTES:
  return getQueryAttributes();
 case QUERY_COUNTERS:
  return getQueryCounters();
 case STAGE_GRAPH:
  return getStageGraph();
 case STAGE_LIST:
  return getStageList();
 case DONE:
  return Boolean.valueOf(isDone());
 case STARTED:
  return Boolean.valueOf(isStarted());
 }
 throw new IllegalStateException();
}

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

query.setStarted(started.contains(query.getQueryId()));
query.setDone(done.contains(query.getQueryId()));
if (query.getStageList() != null) {
 for (org.apache.hadoop.hive.ql.plan.api.Stage stage : query

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

query.setStarted(started.contains(query.getQueryId()));
query.setDone(done.contains(query.getQueryId()));
if (query.getStageList() != null) {
 for (org.apache.hadoop.hive.ql.plan.api.Stage stage : query

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

protected AtlasEntity getHiveProcessEntity(List<AtlasEntity> inputs, List<AtlasEntity> outputs) throws Exception {
  AtlasEntity ret         = new AtlasEntity(HIVE_TYPE_PROCESS);
  HookContext hookContext = getHiveContext();
  String      queryStr    = hookContext.getQueryPlan().getQueryStr();
  if (queryStr != null) {
    queryStr = queryStr.toLowerCase().trim();
  }
  ret.setAttribute(ATTRIBUTE_QUALIFIED_NAME, getQualifiedName(inputs, outputs));
  ret.setAttribute(ATTRIBUTE_INPUTS, getObjectIds(inputs));
  ret.setAttribute(ATTRIBUTE_OUTPUTS,  getObjectIds(outputs));
  ret.setAttribute(ATTRIBUTE_NAME, queryStr);
  ret.setAttribute(ATTRIBUTE_OPERATION_TYPE, hookContext.getOperationName());
  ret.setAttribute(ATTRIBUTE_START_TIME, hookContext.getQueryPlan().getQueryStartTime());
  ret.setAttribute(ATTRIBUTE_END_TIME, System.currentTimeMillis());
  ret.setAttribute(ATTRIBUTE_USER_NAME, getUserName());
  ret.setAttribute(ATTRIBUTE_QUERY_TEXT, queryStr);
  ret.setAttribute(ATTRIBUTE_QUERY_ID, hookContext.getQueryPlan().getQuery().getQueryId());
  ret.setAttribute(ATTRIBUTE_QUERY_PLAN, "Not Supported");
  ret.setAttribute(ATTRIBUTE_RECENT_QUERIES, Collections.singletonList(queryStr));
  return ret;
}

相关文章