@Override public void close() throws IOException { if (appender != null) { appender.close(); // Collect statistics data StatisticsUtil.aggregateTableStat(aggregatedStats, appender.getStats()); context.setResultStats(aggregatedStats); } super.close(); }
@Override public void close() throws IOException { if (appender != null) { appender.close(); // Collect statistics data StatisticsUtil.aggregateTableStat(aggregatedStats, appender.getStats()); context.setResultStats(aggregatedStats); } super.close(); }
public void close() throws IOException { super.close(); if(appender != null){ appender.flush(); appender.close(); // Collect statistics data StatisticsUtil.aggregateTableStat(sumStats, appender.getStats()); context.setResultStats(sumStats); } appender = null; plan = null; } }
public void close() throws IOException { super.close(); if(appender != null){ appender.flush(); appender.close(); // Collect statistics data StatisticsUtil.aggregateTableStat(sumStats, appender.getStats()); context.setResultStats(sumStats); } appender = null; plan = null; } }
@Override public Tuple next() throws IOException { Tuple tuple; while(!context.isStopped() && (tuple = child.next()) != null) { partKey.set(tuple); // add tuple getAppender(partKey, tuple).addTuple(tuple); } List<TableStats> statSet = new ArrayList<>(); for (Appender app : appenderMap.values()) { app.flush(); app.close(); statSet.add(app.getStats()); } // Collect and aggregated statistics data TableStats aggregated = StatisticsUtil.aggregateTableStat(statSet); context.setResultStats(aggregated); return null; } }
@Override public Tuple next() throws IOException { Tuple tuple; while(!context.isStopped() && (tuple = child.next()) != null) { partKey.set(tuple); // add tuple getAppender(partKey, tuple).addTuple(tuple); } List<TableStats> statSet = new ArrayList<TableStats>(); for (Appender app : appenderMap.values()) { app.flush(); app.close(); statSet.add(app.getStats()); } // Collect and aggregated statistics data TableStats aggregated = StatisticsUtil.aggregateTableStat(statSet); context.setResultStats(aggregated); return null; } }
public void close() throws IOException { super.close(); if(appender != null){ appender.flush(); appender.close(); // Collect statistics data if (sumStats == null) { context.setResultStats(appender.getStats()); } else { StatisticsUtil.aggregateTableStat(sumStats, appender.getStats()); context.setResultStats(sumStats); } if (context.getTaskId() != null) { context.addShuffleFileOutput(0, context.getTaskId().toString()); } } appender = null; plan = null; } }
public void close() throws IOException { super.close(); if(appender != null){ appender.flush(); appender.close(); // Collect statistics data if (sumStats == null) { context.setResultStats(appender.getStats()); } else { StatisticsUtil.aggregateTableStat(sumStats, appender.getStats()); context.setResultStats(sumStats); } if (context.getTaskId() != null) { context.addShuffleFileOutput(0, context.getTaskId().toString()); } } appender = null; plan = null; } }
@Override public Tuple next() throws IOException { Tuple tuple; while(!context.isStopped() && (tuple = child.next()) != null) { appender.addTuple(tuple); if (maxPerFileSize > 0 && maxPerFileSize <= appender.getEstimatedOutputSize()) { appender.close(); writtenFileNum++; StatisticsUtil.aggregateTableStat(sumStats, appender.getStats()); openNewFile(writtenFileNum); } } return null; }
@Override public Tuple next() throws IOException { Tuple tuple; while(!context.isStopped() && (tuple = child.next()) != null) { appender.addTuple(tuple); if (maxPerFileSize > 0 && maxPerFileSize <= appender.getEstimatedOutputSize()) { appender.close(); writtenFileNum++; StatisticsUtil.aggregateTableStat(sumStats, appender.getStats()); openNewFile(writtenFileNum); } } return null; }
@Override public Tuple next() throws IOException { Tuple tuple; while(!context.isStopped() && (tuple = child.next()) != null) { if (prevKey == null) { appender = getNextPartitionAppender(getSubdirectory(tuple)); prevKey = new ComparableTuple(inSchema, keyIds); prevKey.set(tuple); } else if (!prevKey.equals(tuple)) { appender.close(); StatisticsUtil.aggregateTableStat(aggregatedStats, appender.getStats()); appender = getNextPartitionAppender(getSubdirectory(tuple)); prevKey.set(tuple); // reset all states for file rotating writtenFileNum = 0; } appender.addTuple(tuple); if (maxPerFileSize > 0 && maxPerFileSize <= appender.getEstimatedOutputSize()) { appender.close(); writtenFileNum++; StatisticsUtil.aggregateTableStat(aggregatedStats, appender.getStats()); openAppender(writtenFileNum); } } return null; }
@Override public Tuple next() throws IOException { Tuple tuple; while(!context.isStopped() && (tuple = child.next()) != null) { if (prevKey == null) { appender = getNextPartitionAppender(getSubdirectory(tuple)); prevKey = new ComparableTuple(inSchema, keyIds); prevKey.set(tuple); } else if (!prevKey.equals(tuple)) { appender.close(); StatisticsUtil.aggregateTableStat(aggregatedStats, appender.getStats()); appender = getNextPartitionAppender(getSubdirectory(tuple)); prevKey.set(tuple); // reset all states for file rotating writtenFileNum = 0; } appender.addTuple(tuple); if (maxPerFileSize > 0 && maxPerFileSize <= appender.getEstimatedOutputSize()) { appender.close(); writtenFileNum++; StatisticsUtil.aggregateTableStat(aggregatedStats, appender.getStats()); openAppender(writtenFileNum); } } return null; }
appender.close(); TableStats stat = appender.getStats(); assertEquals(0, stat.getNumRows().longValue());
appender.close(); testDataStats = appender.getStats(); employee = new TableDesc( IdentifierUtil.buildFQName(TajoConstants.DEFAULT_DATABASE_NAME, "employee"), schema, employeeMeta,
largeScore.setStats(appender.getStats()); catalog.createTable(largeScore);
TableStats stat = appender.getStats(); assertEquals(tupleNum, stat.getNumRows().longValue());
TableStats stat = appender.getStats(); assertEquals(tupleNum, stat.getNumRows().longValue());