Examples of TableStat


Examples of org.apache.tajo.catalog.statistics.TableStat

      vTuple.put(1, DatumFactory.createInt8(25l));
      appender.addTuple(vTuple);
    }
    appender.close();

    TableStat stat = appender.getStats();
    assertEquals(tupleNum, stat.getNumRows().longValue());
    tablePath = tablePath.suffix(extention);

    FileStatus status = fs.getFileStatus(tablePath);
    long fileLen = status.getLen();
    long randomNum = (long) (Math.random() * fileLen) + 1;
View Full Code Here

Examples of org.apache.tajo.catalog.statistics.TableStat

      vTuple.put(1, DatumFactory.createInt8(25l));
      appender.addTuple(vTuple);
    }
    appender.close();

    TableStat stat = appender.getStats();
    assertEquals(tupleNum, stat.getNumRows().longValue());
    tablePath = tablePath.suffix(extension);
    FileStatus status = fs.getFileStatus(tablePath);
    long fileLen = status.getLen();
    Fragment[] tablets = new Fragment[1];
    tablets[0] = new Fragment(fileName, tablePath, meta, 0, fileLen);
View Full Code Here

Examples of org.apache.tajo.catalog.statistics.TableStat

      vTuple.put(3, DatumFactory.createInt8(25l));
      appender1.addTuple(vTuple);
    }
    appender1.close();
   
    TableStat stat1 = appender1.getStats();
    if (stat1 != null) {
      assertEquals(tupleNum, stat1.getNumRows().longValue());
    }

    Path table2Path = new Path(testDir, storeType + "_2.data");
    Appender appender2 = StorageManagerFactory.getStorageManager(conf).getAppender(meta, table2Path);
    appender2.enableStats();
    appender2.init();

    for(int i = 0; i < tupleNum; i++) {
      vTuple = new VTuple(4);
      vTuple.put(0, DatumFactory.createInt4(i + 1));
      vTuple.put(1, DatumFactory.createText("hyunsik"));
      vTuple.put(2, DatumFactory.createText("jihoon"));
      vTuple.put(3, DatumFactory.createInt8(25l));
      appender2.addTuple(vTuple);
    }
    appender2.close();

    TableStat stat2 = appender2.getStats();
    if (stat2 != null) {
      assertEquals(tupleNum, stat2.getNumRows().longValue());
    }


    FileStatus status1 = fs.getFileStatus(table1Path);
    FileStatus status2 = fs.getFileStatus(table2Path);
View Full Code Here

Examples of org.apache.tajo.catalog.statistics.TableStat

        vTuple.put(0, DatumFactory.createInt4(i + 1));
        vTuple.put(1, DatumFactory.createInt8(25l));
        appender.addTuple(vTuple);
      }
      appender.close();
      TableStat stat = appender.getStats();
      assertEquals(tupleNum, stat.getNumRows().longValue());

      FileStatus status = fs.getFileStatus(tablePath);
      long fileLen = status.getLen();
      long randomNum = (long) (Math.random() * fileLen) + 1;

View Full Code Here

Examples of org.apache.tajo.catalog.statistics.TableStat

      vTuple.put(1, DatumFactory.createInt8(25l));
      appender.addTuple(vTuple);
    }
    appender.close();

    TableStat stat = appender.getStats();
    assertEquals(tupleNum, stat.getNumRows().longValue());
    tablePath = tablePath.suffix(extention);

    FileStatus status = fs.getFileStatus(tablePath);
    long fileLen = status.getLen();
    long randomNum = (long) (Math.random() * fileLen) + 1;
View Full Code Here

Examples of org.apache.tajo.catalog.statistics.TableStat

      vTuple.put(1, DatumFactory.createInt8(25l));
      appender.addTuple(vTuple);
    }
    appender.close();

    TableStat stat = appender.getStats();
    assertEquals(tupleNum, stat.getNumRows().longValue());
    tablePath = tablePath.suffix(extension);
    FileStatus status = fs.getFileStatus(tablePath);
    long fileLen = status.getLen();
    Fragment[] tablets = new Fragment[1];
    tablets[0] = new Fragment(fileName, tablePath, meta, 0, fileLen);
View Full Code Here

Examples of org.apache.tajo.catalog.statistics.TableStat

      return this.stat;
    }
    if (!p.hasStat()) {
      return null;
    }
    this.stat = new TableStat(p.getStat());
    return this.stat;
  }
View Full Code Here

Examples of org.apache.tajo.catalog.statistics.TableStat

      TableMeta meta = subQuery.getTableMeta();
      try {
        FileSystem fs = finalOutputDir.getFileSystem(query.systemConf);
        ContentSummary directorySummary = fs.getContentSummary(finalOutputDir);
        if(meta.getStat() == null) meta.setStat(new TableStat());
        meta.getStat().setNumBytes(directorySummary.getLength());
      } catch (IOException e) {
        LOG.error(e.getMessage(), e);
      }
      TableDesc outputTableDesc = new TableDescImpl(outputTableName, meta, finalOutputDir);
View Full Code Here

Examples of org.apache.tajo.catalog.statistics.TableStat

        partitions.add(entry);
      }
      this.getQueryUnit().setIntermediateData(partitions);
    }
    if (report.hasResultStats()) {
      this.getQueryUnit().setStats(new TableStat(report.getResultStats()));
    }
  }
View Full Code Here

Examples of org.apache.tajo.catalog.statistics.TableStat

    public static long getInputVolume(MasterPlan masterPlan, QueryMasterTask.QueryMasterTaskContext context, ExecutionBlock execBlock) {
      Map<String, TableDesc> tableMap = context.getTableDescMap();
      if (masterPlan.isLeaf(execBlock)) {
        ScanNode outerScan = execBlock.getScanNodes()[0];
        TableStat stat = tableMap.get(outerScan.getCanonicalName()).getMeta().getStat();
        return stat.getNumBytes();
      } else {
        long aggregatedVolume = 0;
        for (ExecutionBlock childBlock : masterPlan.getChilds(execBlock)) {
          SubQuery subquery = context.getSubQuery(childBlock.getId());
          aggregatedVolume += subquery.getTableStat().getNumBytes();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.