Package org.apache.tajo.catalog.statistics

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


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

    TableStats 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


      vTuple.put(2, DatumFactory.createText(String.valueOf(i)));
      appender.addTuple(vTuple);
    }
    appender.close();

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

      vTuple.put(3, DatumFactory.createInt8(25l));
      appender1.addTuple(vTuple);
    }
    appender1.close();

    TableStats 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, schema, 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();

    TableStats 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

 
  public TableDesc(TableDescProto proto) {
    this(proto.getTableName(), new Schema(proto.getSchema()),
        new TableMeta(proto.getMeta()), new Path(proto.getPath()), proto.getIsExternal());
    if(proto.hasStats()) {
      this.stats = new TableStats(proto.getStats());
    }
    if (proto.hasPartition()) {
      this.partitionMethodDesc = new PartitionMethodDesc(proto.getPartition());
    }
  }
View Full Code Here

      }
    }
  }

  public TableStats getTableStat() {
    TableStats stat = new TableStats();

    ColumnStats columnStats;
    for (int i = 0; i < schema.size(); i++) {
      columnStats = new ColumnStats(schema.getColumn(i));
      columnStats.setNumNulls(numNulls[i]);
      columnStats.setMinValue(minValues.get(i));
      columnStats.setMaxValue(maxValues.get(i));
      stat.addColumnStat(columnStats);
    }

    stat.setNumRows(this.numRows);
    stat.setNumBytes(this.numBytes);

    return stat;
  }
View Full Code Here

TOP

Related Classes of org.apache.tajo.catalog.statistics.TableStats

Copyright © 2018 www.massapicom. 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.