public boolean isAggregating() { return basicStatsWork != null && basicStatsWork.getAggKey() != null; } }
public String getTableName() { BasicStatsWork work = this; if (work.getLoadTableDesc() != null) { return work.getLoadTableDesc().getTable().getTableName(); } else if (work.getTableSpecs() != null) { return work.getTableSpecs().tableName; } else if (getLoadFileDesc().getCtasCreateTableDesc() != null) { return getLoadFileDesc().getCtasCreateTableDesc().getTableName(); } else { return getLoadFileDesc().getCreateViewDesc().getViewName(); } }
public Task getSourceTask() { return basicStatsWork == null ? null : basicStatsWork.getSourceTask(); }
public boolean isTargetRewritten() { // ANALYZE TABLE if (isExplicitAnalyze()) { return true; } // INSERT OVERWRITE LoadTableDesc ltd = getLoadTableDesc(); if (ltd != null && (ltd.getLoadFileType() == LoadFileType.REPLACE_ALL || ltd.isInsertOverwrite())) { return true; } // CREATE TABLE ... AS if (getLoadFileDesc() != null && getLoadFileDesc().getCtasCreateTableDesc() != null) { return true; } // CREATE MV ... AS // ALTER MV ... REBUILD if (getLoadFileDesc() != null && getLoadFileDesc().getCreateViewDesc() != null) { return true; } return false; }
BasicStatsWork basicStatsWork = new BasicStatsWork(table.getTableSpec()); basicStatsWork.setIsExplicitAnalyze(true); basicStatsWork.setNoScanAnalyzeCommand(parseContext.getQueryProperties().isNoScanAnalyzeCommand()); StatsWork columnStatsWork = new StatsWork(table, basicStatsWork, parseContext.getConf()); columnStatsWork.collectStatsFromAggregator(tableScan.getConf());
basicStatsWork = new BasicStatsWork(tableSpec); } else { basicStatsWork = new BasicStatsWork(ltd); basicStatsWork.setNoStatsAggregator(true); basicStatsWork.setClearAggregatorStats(true); StatsWork columnStatsWork = new StatsWork(tblObj, basicStatsWork, conf);
if (!getWork().getNoStatsAggregator() && !getWork().isNoScanAnalyzeCommand()) { try { scc = getContext(); if (work.isStatsReliable()) { ret = 1; db.alterPartitions(tableFullName, updates, environmentContext, true); if (work.isStatsReliable() && updates.size() != processors.size()) { LOG.info("Stats should be reliadble...however seems like there were some issue.. => ret 1"); ret = 1; if (work.isStatsReliable()) { ret = 1;
public Object process(StatsAggregator statsAggregator) throws HiveException, MetaException { Partish p = partish; Map<String, String> parameters = p.getPartParameters(); if (work.isTargetRewritten()) { StatsSetupConst.setBasicStatsState(parameters, StatsSetupConst.TRUE); if (!work.isExplicitAnalyze() && !followedColStats1) { StatsSetupConst.clearColumnStatsState(parameters); if (work.isClearAggregatorStats()) {
private StatsCollectionContext getContext() throws HiveException { StatsCollectionContext scc = new StatsCollectionContext(conf); Task sourceTask = getWork().getSourceTask(); if (sourceTask == null) { throw new HiveException(ErrorMsg.STATSAGGREGATOR_SOURCETASK_NULL.getErrorCodedMsg()); } scc.setTask(sourceTask); scc.setStatsTmpDir(this.getWork().getStatsTmpDir()); return scc; }
BasicStatsWork statsWork = new BasicStatsWork(tableScan.getConf().getTableMetadata().getTableSpec()); statsWork.setIsExplicitAnalyze(true); StatsWork columnStatsWork = new StatsWork(table, statsWork, parseContext.getConf()); columnStatsWork.collectStatsFromAggregator(tableScan.getConf());
boolean truncate = false; if (mvWork.getLoadTableWork() != null) { statsWork = new BasicStatsWork(mvWork.getLoadTableWork()); truncate = mvWork.getLoadTableWork().getReplace(); String tableName = mvWork.getLoadTableWork().getTable().getTableName(); statsWork = new BasicStatsWork(mvWork.getLoadFileWork());
BasicStatsWork basicStatsWork = new BasicStatsWork(table.getTableSpec()); basicStatsWork.setIsExplicitAnalyze(true); basicStatsWork.setNoScanAnalyzeCommand(parseContext.getQueryProperties().isNoScanAnalyzeCommand()); StatsWork columnStatsWork = new StatsWork(table, basicStatsWork, parseContext.getConf()); columnStatsWork.collectStatsFromAggregator(tableScan.getConf());
basicStatsWork = new BasicStatsWork(tablepart); } else { basicStatsWork = new BasicStatsWork(ltd); basicStatsWork.setNoStatsAggregator(true); basicStatsWork.setClearAggregatorStats(true); StatsWork columnStatsWork = new StatsWork(table, basicStatsWork, conf);
BasicStatsWork statsWork = new BasicStatsWork(table.getTableSpec()); statsWork.setIsExplicitAnalyze(true); statsWork.setNoScanAnalyzeCommand(noScan); StatsWork columnStatsWork = new StatsWork(table, statsWork, parseCtx.getConf()); columnStatsWork.collectStatsFromAggregator(op.getConf());
BasicStatsWork basicStatsWork = new BasicStatsWork(loadTableWork); basicStatsWork.setNoStatsAggregator(true); basicStatsWork.setClearAggregatorStats(true); StatsWork columnStatsWork = new StatsWork(ts.tableHandle, basicStatsWork, conf); statTask = TaskFactory.get(columnStatsWork);
if (work.getLoadFileDesc() != null) { return null; //we are in CTAS, so we know there are no partitions if (work.getTableSpecs() != null) { TableSpec tblSpec = work.getTableSpecs(); table = tblSpec.tableHandle; if (!table.isPartitioned()) { } else if (work.getLoadTableDesc() != null) { LoadTableDesc tbd = work.getLoadTableDesc(); table = db.getTable(tbd.getTable().getTableName()); if (!table.isPartitioned()) {
public String getAggKey() { return basicStatsWork.getAggKey(); }